Closed anthonyjoeseph closed 3 years ago
Whoops! I accidentally removed Lazy
from some of the docs. I'll figure that out
In case it feels strange to instantiate a Subject
and call subscribe
inside an operator, the implementation of groupBy does something similar.
In a way, liftOperator
is doing a groupBy
and then reversing it. We want to operate over a subset of our source Observable
while only subscribing to it once.
replaced by https://github.com/gcanti/fp-ts-rxjs/pull/47
Closes https://github.com/gcanti/fp-ts-rxjs/issues/39
First draft of a
liftOperator
function that lifts a function from(a.k.a. OperatorFunction<A, B>)
to a function
This allows rxjs operators to be used on an ObservableEither.
This has been implemented for
ReaderObservableEither
&StateReaderObservableEither
as well.I would call this experimental. I have not used it in production a ton, and even changed the implementation while writing this PR (I realized the need for a
takeUntil
).I am also not sure how this fits in with the ethos of the
fp-ts-rxjs
library.liftOperator
allows for operators likescan
andtap
, which are impure at heart. Its implementation usesSubjects
which are inherently imperative. Though I loverxjs
and it's utility, I'm not sure if usefulness is a priority over purity for this lib.I have been comfortable using this in production as it's relatively simple, but I would be willing to release this as a separate npm package if that would be better.