Open semmel opened 1 year ago
I'm bit by this as well withLatestFrom seems to be swallowing events around a potential "circular" dependency:
const qUnavailable = Bacon.constant(true).flatMap(() =>
qProp.map(query => query.attr === undefined)
);
const eventsSub = events
.log("searchEvent")
.holdWhen(qUnavailable)
.log("searchQueryReady")
.withLatestFrom(
qProp.log("query"),
(event, query) => ({
event: event,
query: query,
})
).onValue();
B.later(1, "foo")
is likeB.later(0, "foo")
but only when running in Node – as different from when running in browsers.demo code:
For a nice surprise execute that in Node, e.g. from a project shell where baconjs is installed:
whereas in browser dev tools there is no event output :
I guess I have to treat synchronicity or atomic updates with a grain of salt. 🤔