75b6e37f63065f66c0463a5e74eb22b3fd55524e63c77008f10e0c448d69255fe0724840dce58443c877949bf2594b887902616f500c71c62b333a21c7555b 1.2 KB

12345678910111213141516171819
  1. import { Observable } from '../Observable';
  2. import { ConnectableObservable } from '../observable/ConnectableObservable';
  3. import { UnaryFunction } from '../types';
  4. /**
  5. * Creates a {@link ConnectableObservable} that utilizes a {@link BehaviorSubject}.
  6. *
  7. * @param initialValue The initial value passed to the {@link BehaviorSubject}.
  8. * @return A function that returns a {@link ConnectableObservable}
  9. * @deprecated Will be removed in v8. To create a connectable observable that uses a
  10. * {@link BehaviorSubject} under the hood, use {@link connectable}.
  11. * `source.pipe(publishBehavior(initValue))` is equivalent to
  12. * `connectable(source, { connector: () => new BehaviorSubject(initValue), resetOnDisconnect: false })`.
  13. * If you're using {@link refCount} after `publishBehavior`, use the {@link share} operator instead.
  14. * `source.pipe(publishBehavior(initValue), refCount())` is equivalent to
  15. * `source.pipe(share({ connector: () => new BehaviorSubject(initValue), resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false }))`.
  16. * Details: https://rxjs.dev/deprecations/multicasting
  17. */
  18. export declare function publishBehavior<T>(initialValue: T): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
  19. //# sourceMappingURL=publishBehavior.d.ts.map