mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-06 08:25:19 +01:00
20 lines
303 B
JavaScript
20 lines
303 B
JavaScript
import {Emitter} from './emitter';
|
|
import {NOOP} from '../gems/func';
|
|
|
|
export class ConstantStream extends Emitter {
|
|
|
|
constructor(value) {
|
|
super();
|
|
this._value = value;
|
|
}
|
|
|
|
get value() {
|
|
return this._value;
|
|
}
|
|
|
|
attach(observer) {
|
|
observer(this._value);
|
|
return NOOP;
|
|
}
|
|
}
|
|
|