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) 549 B
import {createStream, createProperty} from '../patterns/two-sources' import {NOTHING} from '../constants' const mixin = { _handlePrimaryValue(x) { if (this._lastSecondary !== NOTHING) { this._emitValue(x) } }, _handleSecondaryEnd() { if (this._lastSecondary === NOTHING) { this._emitEnd() } }, } const S = createStream('skipUntilBy', mixin) const P = createProperty('skipUntilBy', mixin) export default function skipUntilBy(primary, secondary) { return new (primary._ofSameType(S, P))(primary, secondary) }