BACK
ReferencepublishReplay
Reference · 88

publishReplay

publishReplay

Deprecated
rxjs.dev

Multicast via a ReplaySubject.

Signature

publishReplay(bufferSize?: number): UnaryFunction, ConnectableObservable>

What it does

Caches the last bufferSize values in a ReplaySubject and hands them to the connectable Observable's subscribers.

When to use

Supporting legacy code. In new code, use shareReplay with a config.

Deprecated API

Marked deprecated in RxJS 7. In new code, use shareReplay({ bufferSize, refCount: true }).

See also

shareReplay, ReplaySubject

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...