How to use the @most/disposable.disposeAll 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 / combine.ts View on Github external
run(sink: Sink<b>, scheduler: Scheduler): Disposable {
    const l = this.sources.length
    const disposables = new Array(l)
    const sinks = new Array(l)

    const mergeSink = new CombineSink(disposables, sinks.length, sink, this.f)

    for (let indexSink, i = 0; i &lt; l; ++i) {
      indexSink = sinks[i] = new IndexSink(i, mergeSink)
      disposables[i] = this.sources[i].run(indexSink, scheduler)
    }

    return disposeAll(disposables)
  }
}</b>
github mostjs / core / packages / core / src / combinator / zip.ts View on Github external
run(sink: Sink, scheduler: Scheduler): Disposable {
    const l = this.sources.length
    const disposables = new Array(l)
    const sinks = new Array(l)
    const buffers = new Array(l)

    const zipSink = new ZipSink(this.f, buffers, sinks, sink)

    for (let indexSink, i = 0; i &lt; l; ++i) {
      buffers[i] = new Queue()
      indexSink = sinks[i] = new IndexSink(i, zipSink)
      disposables[i] = this.sources[i].run(indexSink, scheduler)
    }

    return disposeAll(disposables)
  }
}
github mostjs / core / packages / core / src / combinator / merge.ts View on Github external
run(sink: Sink<a>, scheduler: Scheduler): Disposable {
    const l = this.sources.length
    const disposables: Disposable[] = new Array(l)
    const sinks: Sink</a><a>[] = new Array(l)

    const mergeSink = new MergeSink(disposables, sinks, sink)

    for (let indexSink, i = 0; i &lt; l; ++i) {
      indexSink = sinks[i] = new IndexSink(i, mergeSink)
      disposables[i] = this.sources[i].run(indexSink, scheduler)
    }

    return disposeAll(disposables)
  }
}</a>
github mostjs / core / packages / core / src / combinator / mergeConcurrently.ts View on Github external
dispose(): void {
    this.active = false
    this.pending.length = 0
    this.disposable.dispose()
    disposeAll(this.current).dispose()
  }

@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