What is the order of event handling for the spill function in Reactive-Banana?

I tested this and it seems that the order of event handling is the same as the order of the list in the source event. I don't think I can rely on this as the documentation only states:

Emit simultaneous event occurrences. Up to strictness, we have spill . collect = id

How can I create a function similar to spill with a specification like:

Emit sequential event occurrences with the guarantee that no other events will fire between the first and last

Or should I try a different approach? I am trying to implementing macro functionality in Reactive-Banana

Answers


(I'm the author of reactive-banana.)

It seems that the order of event handling is the same as the order of the list in the source event.

This is correct, you can rely on that. In fact, it more or less follows from the equation spill . collect = id. After all, to yield the identity mapping, spill must preserve the order of the events ascollect has put them in the list.

Furthermore, you can inspect the source code of the modules Reactive.Banana.Model (Reactive.Banana.Internal.Model in version 0.5) and Reactive.Banana.Combinators. Taken together, they give an authoritative model implementation. You can directly check how spill behaves. (Though it may be a little confusing since the model is built in two parts.)

Nonetheless, I shall add a few words to the documentation.


Need Your Help

IE8 force refreshes the webpage using compatibility view

javascript jquery html css internet-explorer-8

I'm using a simple JavaScript method to open colorbox on button click & it works fine in all browsers except IE8 where it will refresh the page push browser in compatibility mode. Here is sampl...

How to truncate text from MySQL database with PHP? (Add '...' after characters limited)

php html text truncate

I want to show snippets of 2 posts on the homepage. Here is the code I have: