A BehaviorSubject holds one value (so we actually need to initialize a default value). When it is subscribed it emits that value immediately. A Subject on the other hand, doesn’t hold a value.
Read moreWhy do we use BehaviorSubject?
Behavior Subject is a part of the RxJs library and is used for cross component communications . We can send data from one component to other components using Behavior Subject. In Behavior Subject we can set the initial value .
Read moreWhat is BehaviorSubject?
BehaviorSubject is a type of subject , a subject is a special type of observable so you can subscribe to messages like any other observable. The unique features of BehaviorSubject are: It needs an initial value as it must always return a value on subscription even if it hasn’t received a next()17 Tem 2017
Read moreWhat is BehaviorSubject in RxJs?
BehaviorSubject is a variant of a Subject which has a notion of the current value that it stores and emits to all new subscriptions . This current value is either the item most recently emitted by the source observable or a seed/default value if none has yet been emitted.
Read more