Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function create(replay, bufferSize, initialValue) {
var sink = new _Subscription.Subscription();
var stream = undefined;
if (!replay) {
stream = new _most.Stream(new _MulticastSource2.default(sink));
} else {
stream = bufferSize === 1 ? (0, _hold2.default)(new _most.Stream(sink)) : (0, _ReplaySource.replay)(new _most.Stream(sink), bufferSize);
}
stream.drain();
if (typeof initialValue !== 'undefined') {
sink.next(initialValue);
}
return { sink: sink, stream: stream, observer: sink };
}
function create() {
var sink = new Subscription();
var stream = new _most.Stream(new _MulticastSource2.default(sink));
return { sink: sink, stream: stream };
}
function create(replay, bufferSize, initialValue) {
var sink = new _Subscription.Subscription();
var stream = undefined;
if (!replay) {
stream = new _most.Stream(new _MulticastSource2.default(sink));
} else {
stream = bufferSize === 1 ? (0, _hold2.default)(new _most.Stream(sink)) : (0, _ReplaySource.replay)(new _most.Stream(sink), bufferSize);
}
stream.drain();
if (typeof initialValue !== 'undefined') {
sink.next(initialValue);
}
return { sink: sink, stream: stream, observer: sink };
}
export default function createStateStream(store) {
return new Stream({
run: (sink, scheduler) => {
const unsubscribe = store.subscribe(() => {
sink.event(scheduler.now(), store.getState())
})
return {
dispose: () => unsubscribe(),
}
},
})
}
function create(initialValue) {
const sink = new BehaviorSubscription(initialValue)
const stream = new Stream(new MulticastSource(sink))
const holdStream = hold(stream)
holdStream.drain()
return {sink, stream: holdStream}
}
export const sample = curry3((f, sampler, stream) =>
new Stream(new SampleSource(f, sampler, stream)))
export const domEvent = (event, node, capture = false) =>
new Stream(new DomEvent(event, node, capture))