Simple way to get the current value of a BehaviorSubject with rxjs5

后端 未结 2 1877
旧巷少年郎
旧巷少年郎 2020-12-16 09:04

Previously in rxjs4 there was a method in the BehaviorSubject called: getValue() (doc here).

This method does not exist any more in

2条回答
  •  难免孤独
    2020-12-16 09:56

    As was pointed out by artur grzesiak in the comments, the BehaviorSubject interface was cleaned up, and the getter is now just .value.

    I just wanted to add this as an answer because I almost didn't read the comments to the original question, and would have missed the correct answer.

提交回复
热议问题