R.
(Ramda) stands for standard functional toolkit.
Operator counterparts aren't and can't be fully equivalent.
"Kinda the same" – is the current definition.
The following projects, were created with different goals and tradeoffs in mind, so every comparison and analogy is subjective and can be argued. The presence of some operator is not necessary good, as well as the abscence is not necessary bad.
Note, that primitives differ for each library. In descriptions, we broadly refer to all the "observable primitives" as **streams***, though, technically speaking, some of them are rather stream-like entities.
To find something, search for a term you know.
fromPromise
fromPromise
fromPromise
fromPromise
fromEvents
fromEvent
fromEvent
fromEvent
stream
, fromCallback
, fromNodeCallback
, fromPoll
new Stream
new Observable
, bindCallback
, bindNodeCallback
? (make a promise first)
Pay attention that Kefir's merge
accepts arrays while others are variadic.
combine
combine
combineLatest
combine
combine
, sampledBy
sample
, sampleWith
sample
, withLatestFrom
sampleCombine
flatMapConcat
concatMap
concatMap
map + flattenSequentially
Create stream from non-stream values.
KefirJS | MostJS | RxJS | XStream |
---|---|---|---|
interval |
periodic |
interval + map |
periodic |
repeat |
of + R.range |
repeat |
of + R.range |
? |
iterate |
generate |
? |
? |
generate |
generate |
? |
Modify events one to one.
KefirJS | MostJS | RxJS | XStream |
---|---|---|---|
delay |
delay |
delay |
combine(delay(500)) |
– (map) |
timestamp |
timestamp |
– (map) |
Modify events to .
MostJS | RxJS | XStream |
---|---|---|
chain / flatMap |
flatMap |
map + flattenConcurrently |
map + switch |
switchMap / flatMapLatest |
map + flatten |
join |
mergeAll |
flatten |
loop |
scan + map |
fold + map |
– (custom) |
bufferWithCount |
? |
Skip events by predicate or signal.
MostJS | RxJS | XStream |
---|---|---|
skipRepeats |
distinctUntilChanged |
dropRepeats |
skipRepeatsWith |
– (scan) |
dropRepeats |
slice |
skip + take |
drop + take |
skipWhile |
skipWhile |
fold + filter + map |
takeWhile |
takeWhile |
filter + endWhen |
since / skipUntil |
skipUntil |
fold + filter + map |
until / takeUntil |
takeUntil |
filter + endWhen |
during |
window + take(1) |
? |
Combine multiple streams into single.
MostJS | RxJS | XStream |
---|---|---|
zip |
zip |
? |
concat |
concat |
concat |
ap |
combineLatest |
? |
Produce side effect for every event.
MostJS | RxJS | XStream |
---|---|---|
tap |
do / tap |
debug |
Operators which target end event somehow.
MostJS | RxJS | XStream |
---|---|---|
empty |
empty |
empty |
never |
never |
never |
continueWith |
? |
concat |
MostJS | RxJS |
---|---|
– (custom) |
amb / race |
MostJS | RxJS |
---|---|
– (custom) |
Observer
, Observable
, Subject
.Stream
and Property
(like XStream).Stream
(+ community-driven).Stream
and MemoryStream
(like KefirJS).RxJS does not emit initial scan
value as event (use startWith
for that).
Rx.Observable.interval(100).map(x => 1)
.scan(add, 0);
.subscribe(console.log); // 1--2--3--...
Most.periodic(100, 1)
.scan(add, 0);
.observe(console.log); // 0--1--2--3--...
startWith
vs sampleWith
vs continueWith
+ recoverWith
vs skipRepeatsWith
(val vs none vs func vs stream)
tap
is listed in "Transform" section.
startWith
is listed in "Combine" section.
mergeAll
is listed in "Combine" section.
distinct
is not listed in "Filtering" section.
takeUntil
is not listed in "Filtering" section.
just
/ return
should be deprecated in favor of of
.
fromArray
should be deprecated in favor of from
.
bacon-vs-kefir – BaconJS vs KefirJS API comparison
dataflows – web arch. dataflow comparison
stream-conversions – tool for cross-library stream conversions
https://github.com/cujojs/most/issues/171
https://twitter.com/rpominov/status/689566111734599683
https://github.com/zenparsing/es-observable/issues/66
R.
(Ramda) stands for standard functional toolkit.
Operator counterparts aren't and can't be fully equivalent.
"Kinda the same" – is the current definition.
The following projects, were created with different goals and tradeoffs in mind, so every comparison and analogy is subjective and can be argued. The presence of some operator is not necessary good, as well as the abscence is not necessary bad.
Note, that primitives differ for each library. In descriptions, we broadly refer to all the "observable primitives" as **streams***, though, technically speaking, some of them are rather stream-like entities.
To find something, search for a term you know.
fromPromise
fromPromise
fromPromise
fromPromise
fromEvents
fromEvent
fromEvent
fromEvent
stream
, fromCallback
, fromNodeCallback
, fromPoll
new Stream
new Observable
, bindCallback
, bindNodeCallback
? (make a promise first)
map
map
, constant
map
, mapTo
map
filter
filter
filter
filter
skip
skip
skip
drop
take
take
take
take
scan
scan
scan
fold
merge
merge
merge
merge
Pay attention that Kefir's merge
accepts arrays while others are variadic.
combine
combine
combineLatest
combine
combine
, sampledBy
sample
, sampleWith
sample
, withLatestFrom
sampleCombine
flatMapConcat
concatMap
concatMap
map + flattenSequentially
Create stream from non-stream values.
KefirJS | MostJS | RxJS | XStream |
---|---|---|---|
interval |
periodic |
interval + map |
periodic |
repeat |
of + R.range |
repeat |
of + R.range |
? |
iterate |
generate |
? |
? |
generate |
generate |
? |
Modify events one to one.
KefirJS | MostJS | RxJS | XStream |
---|---|---|---|
delay |
delay |
delay |
combine(delay(500)) |
– (map) |
timestamp |
timestamp |
– (map) |
Modify events to .
MostJS | RxJS | XStream |
---|---|---|
chain / flatMap |
flatMap |
map + flattenConcurrently |
map + switch |
switchMap / flatMapLatest |
map + flatten |
join |
mergeAll |
flatten |
loop |
scan + map |
fold + map |
– (custom) |
bufferWithCount |
? |
Skip events by predicate or signal.
MostJS | RxJS | XStream |
---|---|---|
skipRepeats |
distinctUntilChanged |
dropRepeats |
skipRepeatsWith |
– (scan) |
dropRepeats |
slice |
skip + take |
drop + take |
skipWhile |
skipWhile |
fold + filter + map |
takeWhile |
takeWhile |
filter + endWhen |
since / skipUntil |
skipUntil |
fold + filter + map |
until / takeUntil |
takeUntil |
filter + endWhen |
during |
window + take(1) |
? |
Combine multiple streams into single.
MostJS | RxJS | XStream |
---|---|---|
zip |
zip |
? |
concat |
concat |
concat |
ap |
combineLatest |
? |
Produce side effect for every event.
MostJS | RxJS | XStream |
---|---|---|
tap |
do / tap |
debug |
Operators which target end event somehow.
MostJS | RxJS | XStream |
---|---|---|
empty |
empty |
empty |
never |
never |
never |
continueWith |
? |
concat |
MostJS | RxJS |
---|---|
– (custom) |
amb / race |
MostJS | RxJS |
---|---|
– (custom) |
Observer
, Observable
, Subject
.Stream
and Property
(like XStream).Stream
(+ community-driven).Stream
and MemoryStream
(like KefirJS).RxJS does not emit initial scan
value as event (use startWith
for that).
Rx.Observable.interval(100).map(x => 1)
.scan(add, 0);
.subscribe(console.log); // 1--2--3--...
Most.periodic(100, 1)
.scan(add, 0);
.observe(console.log); // 0--1--2--3--...
startWith
vs sampleWith
vs continueWith
+ recoverWith
vs skipRepeatsWith
(val vs none vs func vs stream)
tap
is listed in "Transform" section.
startWith
is listed in "Combine" section.
mergeAll
is listed in "Combine" section.
distinct
is not listed in "Filtering" section.
takeUntil
is not listed in "Filtering" section.
just
/ return
should be deprecated in favor of of
.
fromArray
should be deprecated in favor of from
.
bacon-vs-kefir – BaconJS vs KefirJS API comparison
dataflows – web arch. dataflow comparison
stream-conversions – tool for cross-library stream conversions
https://github.com/cujojs/most/issues/171