e76dc8279699e4b3427d2cac7792fbb5435104947bb10791cdfa85e245ea5710f8dddee9af0b4af178aa1d2eb52c7ae84ca0671a313598b740d8bdbae92298 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import { Subject } from '../Subject';
  2. import { Observable } from '../Observable';
  3. import { ConnectableObservable } from '../observable/ConnectableObservable';
  4. import { OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';
  5. /**
  6. * An operator that creates a {@link ConnectableObservable}, that when connected,
  7. * with the `connect` method, will use the provided subject to multicast the values
  8. * from the source to all consumers.
  9. *
  10. * @param subject The subject to multicast through.
  11. * @return A function that returns a {@link ConnectableObservable}
  12. * @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
  13. * If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
  14. * `multicast(subject), refCount()` is equivalent to
  15. * `share({ connector: () => subject, resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
  16. * Details: https://rxjs.dev/deprecations/multicasting
  17. */
  18. export declare function multicast<T>(subject: Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
  19. /**
  20. * Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
  21. * rather than duplicate the effort of documenting the same behavior, please see documentation for the
  22. * {@link connect} operator.
  23. *
  24. * @param subject The subject used to multicast.
  25. * @param selector A setup function to setup the multicast
  26. * @return A function that returns an observable that mirrors the observable returned by the selector.
  27. * @deprecated Will be removed in v8. Use the {@link connect} operator instead.
  28. * `multicast(subject, selector)` is equivalent to
  29. * `connect(selector, { connector: () => subject })`.
  30. * Details: https://rxjs.dev/deprecations/multicasting
  31. */
  32. export declare function multicast<T, O extends ObservableInput<any>>(subject: Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
  33. /**
  34. * An operator that creates a {@link ConnectableObservable}, that when connected,
  35. * with the `connect` method, will use the provided subject to multicast the values
  36. * from the source to all consumers.
  37. *
  38. * @param subjectFactory A factory that will be called to create the subject. Passing a function here
  39. * will cause the underlying subject to be "reset" on error, completion, or refCounted unsubscription of
  40. * the source.
  41. * @return A function that returns a {@link ConnectableObservable}
  42. * @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
  43. * If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
  44. * `multicast(() => new BehaviorSubject('test')), refCount()` is equivalent to
  45. * `share({ connector: () => new BehaviorSubject('test') })`.
  46. * Details: https://rxjs.dev/deprecations/multicasting
  47. */
  48. export declare function multicast<T>(subjectFactory: () => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
  49. /**
  50. * Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
  51. * rather than duplicate the effort of documenting the same behavior, please see documentation for the
  52. * {@link connect} operator.
  53. *
  54. * @param subjectFactory A factory that creates the subject used to multicast.
  55. * @param selector A function to setup the multicast and select the output.
  56. * @return A function that returns an observable that mirrors the observable returned by the selector.
  57. * @deprecated Will be removed in v8. Use the {@link connect} operator instead.
  58. * `multicast(subjectFactory, selector)` is equivalent to
  59. * `connect(selector, { connector: subjectFactory })`.
  60. * Details: https://rxjs.dev/deprecations/multicasting
  61. */
  62. export declare function multicast<T, O extends ObservableInput<any>>(subjectFactory: () => Subject<T>, selector: (shared: Observable<T>) => O): OperatorFunction<T, ObservedValueOf<O>>;
  63. //# sourceMappingURL=multicast.d.ts.map