Giant blob of minor changes
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / rxjs / src / internal / operators / publishBehavior.ts
1 import { Observable } from '../Observable';
2 import { BehaviorSubject } from '../BehaviorSubject';
3 import { multicast } from './multicast';
4 import { ConnectableObservable } from '../observable/ConnectableObservable';
5 import { UnaryFunction } from '../types';
6
7 /**
8  * @param value
9  * @return {ConnectableObservable<T>}
10  * @method publishBehavior
11  * @owner Observable
12  */
13 export function publishBehavior<T>(value: T):  UnaryFunction<Observable<T>, ConnectableObservable<T>> {
14   return (source: Observable<T>) => multicast(new BehaviorSubject<T>(value))(source) as ConnectableObservable<T>;
15 }