combineEvents
combineEvents(events)
Motivation
Method allows to trigger event when all of given events are triggered, with payloads of given events
Formulae
- When all events are triggered, trigger
target
with{key1: firstPayload, key2: secondPayload}
- When all events are triggered, trigger
target
with[firstPayload, secondPayload]
Arguments
events
— Object or array with events
Returns
target
— Event with the same shape asevents
, that triggered after allevents
triggered
combineEvents({ events, reset, target })
Motivation
Object form which allow to pass reset
unit or target
Formulae
- When all events are triggered, trigger
target
with{key1: firstPayload, key2: secondPayload}
- When all events are triggered, trigger
target
with[firstPayload, secondPayload]
Arguments
events
— Object or array with eventsreset
(Unit<any>)
- Optional. Any unit which will reset state ofcombineEvents
and collecting of payloads will start from scratchtarget
(Unit<Shape>)
- Optional. Any unit with type matchingevents
shape
Returns
target
— Whentarget
option is not defined, will return new event with the same shape asevents
, otherwisetarget
unit will return