@xylabs/threads
Version:
Web workers & worker threads as simple as a function call
25 lines • 1.05 kB
TypeScript
import type { ObservableLike } from 'observable-fns';
import { Observable } from 'observable-fns';
declare const $observers: unique symbol;
/**
* Observable subject. Implements the Observable interface, but also exposes
* the `next()`, `error()`, `complete()` methods to initiate observable
* updates "from the outside".
*
* Use `Observable.from(subject)` to derive an observable that proxies all
* values, errors and the completion raised on this subject, but does not
* expose the `next()`, `error()`, `complete()` methods.
*/
export declare class Subject<T> extends Observable<T> implements ObservableLike<T> {
private [$observers];
constructor();
/** Signal completion to all subscribers. */
complete(): void;
/** Signal an error to all subscribers. */
error(error: any): void;
/** Emit a new value to all subscribers. */
next(value: T): void;
}
/** Re-export of the Observable class from the `observable-fns` library. */
export { Observable } from 'observable-fns';
//# sourceMappingURL=observable.d.ts.map