Learn RxJS
Search
⌃K
Learn RxJS
Search
⌃K
Introduction
Learn RxJS
Operators
Subjects
AsyncSubject
BehaviorSubject
ReplaySubject
Subject
Recipes
Concepts
Powered By
GitBook
BehaviorSubject
Requires an initial value and emits the current value to new subscribers
💡 If you want the last emitted value(s) on subscription, but do not need to supply a seed value, check out
ReplaySubject
instead!
Examples
Example 1: Simple BehaviorSubject
(
Stackblitz
)
// RxJS v6+
import
{
BehaviorSubject
}
from
'rxjs'
;