UNPKG

kefir

Version:

Reactive Programming library for JavaScript inspired by Bacon.js and RxJS with focus on high performance and low memory usage

24 lines (19 loc) 475 B
import {inherit} from '../utils/objects' import AbstractPool from './abstract-pool' import never from '../primary/never' function Merge(sources) { AbstractPool.call(this) this._addAll(sources) this._initialised = true } inherit(Merge, AbstractPool, { _name: 'merge', _onEmpty() { if (this._initialised) { this._emitEnd() } }, }) export default function merge(observables) { return observables.length === 0 ? never() : new Merge(observables) }