export const sendEvents = async ( { user , events , sender , eventHandlers = { } , } ) => { for ( const event of events ) { await sender ( { user , event } ) ; if ( 'onActionSent' in eventHandlers ) { await eventHandlers . onActionSent ( { user , details : event } ) ; } } } ;