- }
-
- export class Cell<A> {
- private str : Stream<A>;
- protected value : A;
- protected valueUpdate : A;
- private cleanup : () => void;
- protected lazyInitValue : Lazy<A>; // Used by LazyCell
- private vertex : Vertex;
-
- constructor(initValue : A, str? : Stream<A>) {
- this.value = initValue;
- if (!str) {
- this.str = new Stream<A>();
- this.vertex = new Vertex("ConstCell", 0, []);
- }
- else
- Transaction.run(() => this.setStream(str));
- }
-
- protected setStream(str : Stream<A>) {