Converting code from Rxjs to xstream

129 Views Asked by At

What will be the equivalent of

return Rx.Observable.merge([deleteTodo$, addTodo$, completeTodo$]).startWith([])
  .scan(function (currentTodos, modifier) { return modifier(currentTodos); });

the above in rxjs in xstream?

1

There are 1 best solutions below

1
Ebuall On

Should be like this. Initial value included as second argument after a function.

xs.merge(deleteTodo$, addTodo$, completeTodo$) .fold(function (currentTodos, modifier) { return modifier(currentTodos); }, [])