c86eec1424e72465d731f2b23eeded86f7e01fecfba7055e0481e7ca3414177f2c8a623992d6fc0c75450b178993f103f724e67c6d79340c49200d57878706 1.3 KB

123456789101112131415161718192021222324252627
  1. import { Connectable, ObservableInput, SubjectLike } from '../types';
  2. export interface ConnectableConfig<T> {
  3. /**
  4. * A factory function used to create the Subject through which the source
  5. * is multicast. By default this creates a {@link Subject}.
  6. */
  7. connector: () => SubjectLike<T>;
  8. /**
  9. * If true, the resulting observable will reset internal state upon disconnection
  10. * and return to a "cold" state. This allows the resulting observable to be
  11. * reconnected.
  12. * If false, upon disconnection, the connecting subject will remain the
  13. * connecting subject, meaning the resulting observable will not go "cold" again,
  14. * and subsequent repeats or resubscriptions will resubscribe to that same subject.
  15. */
  16. resetOnDisconnect?: boolean;
  17. }
  18. /**
  19. * Creates an observable that multicasts once `connect()` is called on it.
  20. *
  21. * @param source The observable source to make connectable.
  22. * @param config The configuration object for `connectable`.
  23. * @returns A "connectable" observable, that has a `connect()` method, that you must call to
  24. * connect the source to all consumers through the subject provided as the connector.
  25. */
  26. export declare function connectable<T>(source: ObservableInput<T>, config?: ConnectableConfig<T>): Connectable<T>;
  27. //# sourceMappingURL=connectable.d.ts.map