Skip to content

shareReplay()

Function

shareReplay<T>(config?: ShareReplayConfig): ContinuingPipeOperator<T, T>

Share the source and replay specified number of emissions on subscription.

ts
declare const read1: Read<string>;
const read: Read<string> = read1.pipe(shareReplay<string>({bufferSize: 1, refCount: true}));

Observable Behavior:

Works exactly like shareReplay of RxJS.

Sync Behavior:

Has no effect on sync calls. The value is just passed through.

Source: rxjs-read/src/lib/operators/share-replay.operator.ts:27

Type parameters

ParameterDescription
Ttype of the value

Parameters

ParameterTypeDescription
config?ShareReplayConfigoptional configuration on how to share the source

Returns

ContinuingPipeOperator<T, T>