Skip to content

Commit

Permalink
Docs: multicast deprecation (#6403)
Browse files Browse the repository at this point in the history
* docs(multicast): mark primary signature as deprecated

* docs(publish): mark primary signature as deprecated

* docs(publishReplay): mark primary signature as deprecated
  • Loading branch information
backbone87 committed May 13, 2021
1 parent 88fdfe9 commit cfd2c16
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/internal/operators/multicast.ts
Expand Up @@ -73,6 +73,12 @@ export function multicast<T, O extends ObservableInput<any>>(
selector: (shared: Observable<T>) => O
): OperatorFunction<T, ObservedValueOf<O>>;

/**
* @deprecated Will be removed in v8. Use the {@link connectable} observable, the {@link connect} operator or the
* {@link share} operator instead. See the overloads below for equivalent replacement examples of this operator's
* behaviors.
* Details: https://rxjs.dev/deprecations/multicasting
*/
export function multicast<T, R>(
subjectOrSubjectFactory: Subject<T> | (() => Subject<T>),
selector?: (source: Observable<T>) => Observable<R>
Expand Down
4 changes: 4 additions & 0 deletions src/internal/operators/publish.ts
Expand Up @@ -79,6 +79,10 @@ export function publish<T, O extends ObservableInput<any>>(selector: (shared: Ob
* Subscribers to the given source will receive all notifications of the source from the time of the subscription on.
* @return A function that returns a ConnectableObservable that upon connection
* causes the source Observable to emit items to its Observers.
* @deprecated Will be removed in v8. Use the {@link connectable} observable, the {@link connect} operator or the
* {@link share} operator instead. See the overloads below for equivalent replacement examples of this operator's
* behaviors.
* Details: https://rxjs.dev/deprecations/multicasting
*/
export function publish<T, R>(selector?: OperatorFunction<T, R>): MonoTypeOperatorFunction<T> | OperatorFunction<T, R> {
return selector ? connect(selector) : multicast(new Subject<T>());
Expand Down
6 changes: 6 additions & 0 deletions src/internal/operators/publishReplay.ts
Expand Up @@ -74,6 +74,12 @@ export function publishReplay<T, O extends ObservableInput<any>>(
timestampProvider: TimestampProvider
): OperatorFunction<T, ObservedValueOf<O>>;

/**
* @deprecated Will be removed in v8. Use the {@link connectable} observable, the {@link connect} operator or the
* {@link share} operator instead. See the overloads below for equivalent replacement examples of this operator's
* behaviors.
* Details: https://rxjs.dev/deprecations/multicasting
*/
export function publishReplay<T, R>(
bufferSize?: number,
windowTime?: number,
Expand Down

0 comments on commit cfd2c16

Please sign in to comment.