source: trip-planner-front/node_modules/rxjs/src/internal/operators/publishBehavior.ts

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 589 bytes
Line 
1import { Observable } from '../Observable';
2import { BehaviorSubject } from '../BehaviorSubject';
3import { multicast } from './multicast';
4import { ConnectableObservable } from '../observable/ConnectableObservable';
5import { UnaryFunction } from '../types';
6
7/**
8 * @param value
9 * @return {ConnectableObservable<T>}
10 * @method publishBehavior
11 * @owner Observable
12 */
13export 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}
Note: See TracBrowser for help on using the repository browser.