Cancel Event on result of Event Stream

13 views
Skip to first unread message

André Oliveira

unread,
Apr 4, 2017, 3:52:15 AM4/4/17
to Bacon.js
Hi,

I'm integrating BaconJS with SlickGrid and I have two events that I'm trying to handle, the OnBeforeMoveRows and OnMoveRows, I've created two streams, one for each. Now what I want is to, after evaluating some function under OnBeforeMoveRows, to be able to stop the flow and prevent moving rows, that would mean returning false or stop propagation. However I can't seem to figure out how to do it, anyone can provide some guidance on this please?



Thank you!

Juha Paananen

unread,
Apr 4, 2017, 3:56:58 AM4/4/17
to André Oliveira, Bacon.js
Usually you use something like takeUntil to take events only until something happens. Not sure about your context but something like

    let shouldStopOnEvent = (x) => something
    onMoveRows.takeUntil(onBeforeMoveRows.filter(shouldStopOnEvent).onValue(x => doStuffHere)


--
You received this message because you are subscribed to the Google Groups "Bacon.js" group.
To post to this group, send email to bac...@googlegroups.com.
Visit this group at https://groups.google.com/group/baconjs.

Reply all
Reply to author
Forward
0 new messages