import { Observable } from '../Observable'; import { BehaviorSubject } from '../BehaviorSubject'; import { multicast } from './multicast'; import { ConnectableObservable } from '../observable/ConnectableObservable'; import { UnaryFunction } from '../interfaces'; /** * @param value * @return {ConnectableObservable} * @method publishBehavior * @owner Observable */ export function publishBehavior(value: T): UnaryFunction, ConnectableObservable> { return (source: Observable) => multicast(new BehaviorSubject(value))(source) as ConnectableObservable; }