f3a05b5deac41d7154ab7d1149d5952c3756594c3228d78634ae209db2b432a062e841382b46923002c9610be1cc7ce38777d0c5170fa23ae9e7ab77c14f06 1.8 KB

123456789101112131415161718192021222324252627282930
  1. import { Observable } from '../Observable';
  2. import { ConnectableObservable } from '../observable/ConnectableObservable';
  3. import { OperatorFunction, UnaryFunction, ObservableInput, ObservedValueOf } from '../types';
  4. /**
  5. * Returns a connectable observable that, when connected, will multicast
  6. * all values through a single underlying {@link Subject} instance.
  7. *
  8. * @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
  9. * `source.pipe(publish())` is equivalent to
  10. * `connectable(source, { connector: () => new Subject(), resetOnDisconnect: false })`.
  11. * If you're using {@link refCount} after `publish`, use {@link share} operator instead.
  12. * `source.pipe(publish(), refCount())` is equivalent to
  13. * `source.pipe(share({ resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
  14. * Details: https://rxjs.dev/deprecations/multicasting
  15. */
  16. export declare function publish<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
  17. /**
  18. * Returns an observable, that when subscribed to, creates an underlying {@link Subject},
  19. * provides an observable view of it to a `selector` function, takes the observable result of
  20. * that selector function and subscribes to it, sending its values to the consumer, _then_ connects
  21. * the subject to the original source.
  22. *
  23. * @param selector A function used to setup multicasting prior to automatic connection.
  24. *
  25. * @deprecated Will be removed in v8. Use the {@link connect} operator instead.
  26. * `publish(selector)` is equivalent to `connect(selector)`.
  27. * Details: https://rxjs.dev/deprecations/multicasting
  28. */
  29. export declare function publish<T, O extends ObservableInput<any>>(selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
  30. //# sourceMappingURL=publish.d.ts.map