Hermanon Stack Overflow • Recommends
On “Rx js understanding the lift method”
lift is used all the time internally in RxJS 5. The principle of lift is that you prepare a new Observable that upon subscribe will forward the events in the way the operator defines. There is a good video about it by Paul Taylor (link to this video). Lift is a very fundamental building block.
Instead of creating a new class - extending Observable - you could also just create the Operator itself. Users of the operator can then call it by writing:
Observable.of(1, 2, 3)
.lift(new MyCustomOperator)
.subscribe()
This means no-one has to learn that yet another operator is available in the Observable API, but instead sees that it is something defined elsewhere.
Ideally you could write
someObserv…