Closed insidewhy closed 8 years ago
Related thing: filter plugin emits Bacon.nothing() when array is empty, which gonna to be a problem with awaiting: if all events are filtered out on initial build phase, awaiting will never gonna end.
That's a sigil and is flattened out.
Emitting empty array could be a solution.
You don't understand: https://github.com/baconjs/bacon.js/#observable-flatmap
I can not understand why do you point me to that documentation section, but change line from return events.length === 0 ? Bacon.never() : events
to return events
does the job.
That piece of documentation explains it. If you can't even understand that then I have to question why you think you're informed enough to give me "advice" (which is all incorrect) on how to fix this.
It comes across as horribly arrogant. First do the research, then learn how to actually use the programming technique and APIs, and then you are qualified to give your opinion. Until then you're wasting everybody's time.
That code is designed to only pass along the empty array in the case it is passed an empty array. If it filters a non-empty array to nothing then the event is hidden. It's clear that it's how it's designed to work if you understand bacon.js
, flatMap
exists to flatten event streams. As I said Bacon.never()
is a sigil, it is never passed along.
I do understood that, thank you sir. Do you close this issue because you won't to implement this thing?
I just finished implementing it, will push soon!
One more thing. Why do you consider to hide event, instead of keeping it empty if it filtered out completely? Performance reasons?
At the moment generally []
is used as an initialisation event (all streams receive it as the first event). It shouldn't hurt to just pass it down by itself though.
First attempt in this commit: https://github.com/sighjs/sigh/commit/58f34318434e9c69e31b7665a234dbd871038e26
Haven't tested it yet.
There it works now, is used as part of sigh
's own build process.
It will operate like https://github.com/Strate/sigh-await-and-merge