How to use @most/disposable - 10 common examples

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
private dispose(t: Time, index: number): void {
    tryDispose(t, this.disposables[index], this.sink)
    if (--this.activeCount === 0) {
      this.sink.end(t)
    }
  }
}
github mostjs / core / packages / core / src / combinator / mergeConcurrently.ts View on Github external
endInner(t: Time, inner: Disposable): void {
    const i = this.current.indexOf(inner)
    if (i >= 0) {
      this.current.splice(i, 1)
    }
    tryDispose(t, inner, this)

    const pending = this.pending
    if (isNonEmpty(pending)) {
      this.startInner(t, pending.shift())
    } else {
      this.checkEnd(t)
    }
  }
github mostjs / core / packages / core / src / combinator / errors.ts View on Github external
error(t: Time, e: E): void {
    const nextSink = this.sink.disable()

    tryDispose(t, this.disposable, this.sink)

    this._startNext(t, e, nextSink)
  }
github mostjs / core / packages / core / src / combinator / merge.ts View on Github external
private dispose(t: Time, index: number): void {
    tryDispose(t, this.disposables[index], this.sink)
    if (--this.activeCount === 0) {
      this.sink.end(t)
    }
  }
}
github mostjs / core / packages / core / src / combinator / mergeConcurrently.ts View on Github external
end(t: Time): void {
    this.active = false
    tryDispose(t, this.disposable, this.sink)
    this.checkEnd(t)
  }
github mostjs / core / packages / core / src / combinator / continueWith.ts View on Github external
end(t: Time): void {
    if (!this.active) {
      return
    }

    tryDispose(t, this.disposable, this.sink)

    this.startNext(t, this.sink)
  }
github mostjs / core / packages / core / src / combinator / switch.ts View on Github external
dispose(t: Time): void {
    tryDispose(t, this.disposable, this.sink)
  }
}
github mostjs / core / packages / core / src / combinator / multicast.ts View on Github external
constructor(source: Stream<a>) {
    this.source = source
    this.sinks = []
    this.disposable = disposeNone()
  }
</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