You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes we need to convert property to stream but preserve current value (as much as a stream can do it — passing current value only to the first subscriber). Opening this issue to collect these use cases.
One such use case is constant([1,2,3]).flatten() that currently dispatches only 3, and can be "fixed" as constant([1,2,3]).toStream().flatten(). But we already considering two other ways of how this case can be fixed: #144#142
What concerns me about this, is that we'll basically get Bacon's once(x) (infamous for its pitfalls for beginners, and problems with semantics) in form of Kefir.constant(x).toStream(), but we already have ways to create onces anyway...
The text was updated successfully, but these errors were encountered:
As someone coming from Bacon I have personally found that a lot of the brain-melting issues have been eliminated in Kefir because of the excellent, exhaustive and explicit documentation provided, which I struggled to find for Bacon. This means that even if there is a (deliberately) nuanced behaviour of an API operation, then it's consequences are comprehensible. However, there's no Royal Road to understanding FRP so I think architecting the library to try and get over fundamental misunderstandings by beginners and eliminating operations needed by power users for this reason sounds like the wrong choice.
I deliberately use streams which are intended to be consumed per-subscriber quite a lot, so I wouldn't favour the prevention of all once()-like behaviours through structural API choices. Rather it might be good to explicitly surface the special capabilities which activation-triggers can provide so people aren't surprised by them, (complementing subscription triggers like 'Property').
Sometimes we need to convert property to stream but preserve current value (as much as a stream can do it — passing current value only to the first subscriber). Opening this issue to collect these use cases.
One such use case is
constant([1,2,3]).flatten()
that currently dispatches only3
, and can be "fixed" asconstant([1,2,3]).toStream().flatten()
. But we already considering two other ways of how this case can be fixed: #144 #142What concerns me about this, is that we'll basically get Bacon's
once(x)
(infamous for its pitfalls for beginners, and problems with semantics) in form ofKefir.constant(x).toStream()
, but we already have ways to createonce
s anyway...The text was updated successfully, but these errors were encountered: