Open jeffrose opened 9 years ago
This would be great. For example most does not have a sampledBy method, but you can simulate it by
passing the trigger stream as the first of two input streams.
sampledBy | -> Stream |
---|---|
most | sampler.sample(f, sampler, stream) |
Bacon | property.sampledBy(streamOrProperty, f) |
Kefir | obs.sampledBy(otherObs, [combinator]) |
I can see the value in helping folks learn most.js if they have experience with other libs.
We're not necessarily experts in using the other libs :) It'd be great if folks who have experience (like you!) could help us build up a "porting guide" like this. For example, I could see working on it incrementally: as you encounter situations you're not sure how to solve using most.js, open an issue and we can work together to find a solution, and then we can add that to the "porting" guide. What do you think?
@benawhite Have a look at sampleWith
:
let sampled = values.sampleWith(sampler)
You can also sample multiple streams at once using sample
, like you suggested:
let sampled = sampler.sample(f, stream1, stream2, stream3, ...);
I wouldn't expect you to be an expert, but a comparison/porting guide would certainly help your library gain adoption. Here is the API Comparison Doc that Kefir has posted for comparing Bacon and Kefir. Maybe you could use that as a template for most vs Bacon vs Kefir. I can't promise that I would be contributing, but putting something out there would give the community a starting point.
Old issue, but I still think it is relevant to compare most and kefir. I'm new to FRP and I'm currently trying to pick a simple/performant/well documented library and both seem to correspond.
@pierreio what will help you swing over to the most
side?
I was mainly looking into a better way to organise the redux side effects, and found redux-observable
which seems to solve that in a very elegant way. I know I can use most
as a backend for it but I'm currently exploring if I can use FRP for more than the async side effects.
The only difference I have seen so far is that kefir
is a bit easier to use when dealing with imperative aspects (pool, emit, property). But most
has an extension for that so it's not a deciding factor.
I think I just have to find out what I want to do with FRP before deciding on the library.
I'm using riot and rethindb. So I use a gist for dispatcher partner. very well and clean. but now I see that usea FRP is neccesary. So start to learning. I discard bacon because use a lot of dependencies and and cycle.js too. so far most.js and kefir are the winners. I think we need some guide for begginer for where start. because is difficult chosse with out experiences. Any advice?
@phtoussaint see https://github.com/ivan-kleshnin/reactive-polyglot and feel free to contribute :)
For developers coming from other FRP libraries, it would be nice to have a comparison table of the common API methods.
For example...
most.fromEvent
Bacon.fromEvent
Kefir.fromEvent
While Kefir has an API almost identical to Bacon, it's not always clear how to achieve the same result in most.