7e91f1e60ef77ad8f65e6bf0693c53e5ac81996461b1aaf09874cccf077fb14ddb3e412d42133105a21d84977cef0e0b493ae15bb2955b4fe58ae690c77a7e 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import { MonoTypeOperatorFunction, SubjectLike, ObservableInput } from '../types';
  2. export interface ShareConfig<T> {
  3. /**
  4. * The factory used to create the subject that will connect the source observable to
  5. * multicast consumers.
  6. */
  7. connector?: () => SubjectLike<T>;
  8. /**
  9. * If `true`, the resulting observable will reset internal state on error from source and return to a "cold" state. This
  10. * allows the resulting observable to be "retried" in the event of an error.
  11. * If `false`, when an error comes from the source it will push the error into the connecting subject, and the subject
  12. * will remain the connecting subject, meaning the resulting observable will not go "cold" again, and subsequent retries
  13. * or resubscriptions will resubscribe to that same subject. In all cases, RxJS subjects will emit the same error again, however
  14. * {@link ReplaySubject} will also push its buffered values before pushing the error.
  15. * It is also possible to pass a notifier factory returning an `ObservableInput` instead which grants more fine-grained
  16. * control over how and when the reset should happen. This allows behaviors like conditional or delayed resets.
  17. */
  18. resetOnError?: boolean | ((error: any) => ObservableInput<any>);
  19. /**
  20. * If `true`, the resulting observable will reset internal state on completion from source and return to a "cold" state. This
  21. * allows the resulting observable to be "repeated" after it is done.
  22. * If `false`, when the source completes, it will push the completion through the connecting subject, and the subject
  23. * will remain the connecting subject, meaning the resulting observable will not go "cold" again, and subsequent repeats
  24. * or resubscriptions will resubscribe to that same subject.
  25. * It is also possible to pass a notifier factory returning an `ObservableInput` instead which grants more fine-grained
  26. * control over how and when the reset should happen. This allows behaviors like conditional or delayed resets.
  27. */
  28. resetOnComplete?: boolean | (() => ObservableInput<any>);
  29. /**
  30. * If `true`, when the number of subscribers to the resulting observable reaches zero due to those subscribers unsubscribing, the
  31. * internal state will be reset and the resulting observable will return to a "cold" state. This means that the next
  32. * time the resulting observable is subscribed to, a new subject will be created and the source will be subscribed to
  33. * again.
  34. * If `false`, when the number of subscribers to the resulting observable reaches zero due to unsubscription, the subject
  35. * will remain connected to the source, and new subscriptions to the result will be connected through that same subject.
  36. * It is also possible to pass a notifier factory returning an `ObservableInput` instead which grants more fine-grained
  37. * control over how and when the reset should happen. This allows behaviors like conditional or delayed resets.
  38. */
  39. resetOnRefCountZero?: boolean | (() => ObservableInput<any>);
  40. }
  41. export declare function share<T>(): MonoTypeOperatorFunction<T>;
  42. export declare function share<T>(options: ShareConfig<T>): MonoTypeOperatorFunction<T>;
  43. //# sourceMappingURL=share.d.ts.map