UNPKG

suspenders-js

Version:

Asynchronous programming library utilizing coroutines, functional reactive programming and structured concurrency.

24 lines 615 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ObserverFunction = void 0; /** * Wrapper around a function that implements Observer<T>. */ class ObserverFunction { constructor(_onNext, _onComplete, _onError) { this._onNext = _onNext; this._onComplete = _onComplete; this._onError = _onError; } emit(value) { this._onNext(value); } complete() { this._onComplete(); } error(error) { this._onError(error); } } exports.ObserverFunction = ObserverFunction; //# sourceMappingURL=ObserverFunction.js.map