How to use the @most/disposable.disposeBoth function in @most/disposable

To help you get started, we’ve selected a few @most/disposable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mostjs / core / packages / core / src / combinator / timeslice.ts View on Github external
run(sink: Sink<a>, scheduler: Scheduler): Disposable {
    const min = new LowerBoundSink(this.minSignal, sink, scheduler)
    const d = this.source.run(new SinceSink(min, sink), scheduler)

    return disposeBoth(min, d)
  }
}</a>
github mostjs / core / packages / core / src / combinator / switch.ts View on Github external
run(sink: Sink<a>, scheduler: Scheduler): Disposable {
    const switchSink = new SwitchSink(sink, scheduler)
    return disposeBoth(switchSink, this.source.run(switchSink, scheduler))
  }
}</a>
github mostjs / core / packages / core / src / combinator / snapshot.ts View on Github external
run(sink: Sink, scheduler: Scheduler): Disposable {
    const sampleSink = new SnapshotSink(this.f, sink)
    const valuesDisposable = this.values.run(sampleSink.latest, scheduler)
    const samplerDisposable = this.sampler.run(sampleSink, scheduler)

    return disposeBoth(samplerDisposable, valuesDisposable)
  }
}
github mostjs / core / packages / core / src / combinator / scan.ts View on Github external
run(sink: Sink<b>, scheduler: Scheduler): Disposable {
    const d1 = asap(propagateEventTask(this.value, sink), scheduler)
    const d2 = this.source.run(new ScanSink(this.f, this.value, sink), scheduler)
    return disposeBoth(d1, d2)
  }
}</b>
github mostjs / core / packages / core / src / combinator / delay.ts View on Github external
run(sink: Sink<a>, scheduler: Scheduler): Disposable {
    const delaySink = new DelaySink(this.dt, sink, scheduler)
    return disposeBoth(delaySink, this.source.run(delaySink, scheduler))
  }
}</a>
github mostjs / core / packages / core / src / combinator / timeslice.ts View on Github external
run(sink: Sink<a>, scheduler: Scheduler): Disposable {
    const disposable = new SettableDisposable()

    const d1 = this.source.run(sink, scheduler)
    const d2 = this.maxSignal.run(new UntilSink(sink, disposable), scheduler)
    disposable.setDisposable(disposeBoth(d1, d2))

    return disposable
  }
}</a>

@most/disposable

Reactive programming with lean, functions-only, curried, tree-shakeable API

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis