Open pbadenski opened 5 years ago
const fold = <T, O extends ObservableInput<T>> (obs: Observable<O>) => observable.chain<O, T>(t => from(t))(obs);
@pbadenski fold
Is an unsafe cast. Perhaps just use map(a => a as Observable<T>)
.
fromTask
and fromObservable
were added by #20 and #21.
foldTask
is now just chain(fromTask)
, which seems like it should just be done inline, instead of being exposed as a helper function.
These can be easily written by a user, but I was wondering if it's worth adding to this library (or least have a section for recipes?). At least in our project these use cases are quite common.