Closed Marcisbee closed 6 years ago
Now can subscribe to multiple events with one subscription and transformer.
const Pressed = new Subscribe() .on('mousedown mouseup', (e, name) => name === 'mousedown') const Mouse = new Store({ pressed: Pressed(false), })
Mouse store will listen to mousedown and mouseup for pressed field.
Mouse
mousedown
mouseup
When mouse is pressed output would be {pressed: true}; When released, it would be {pressed: false}.
{pressed: true}
{pressed: false}
Description
Now can subscribe to multiple events with one subscription and transformer.
Example usage
Mouse
store will listen tomousedown
andmouseup
for pressed field.When mouse is pressed output would be
{pressed: true}
; When released, it would be{pressed: false}
.