ReplaySubject
ReplaySubject is a type of subject in reactive programming (notably in Rx/RxJS) that stores a buffer of previously emitted values and replays them to new subscribers. Unlike a standard Subject, which only delivers new values to listeners from the moment they subscribe, ReplaySubject can provide a history of past events to anyone who subscribes later.
Buffering behavior is configurable. The subject can be created with a bufferSize, which limits how many past
Terminal events are handled in a predictable way. If the ReplaySubject has already completed or errored, new
Common use cases include caching the most recent events for late subscribers, sharing a historical log in