Generalize fields to all is()ables

This commit is contained in:
Tony Garnock-Jones 2022-04-28 23:03:30 +03:00
parent dae63d6961
commit 4a49e6a314
2 changed files with 2 additions and 2 deletions

View File

@ -369,7 +369,7 @@ export class Turn {
this.enqueue(this.activeFacet.actor.root, () => this.activeFacet.actor._terminateWith({ ok: false, err }));
}
field<V extends Value<T>, T = Ref>(initial: V, name?: string): Field<V, T> {
field<V>(initial: V, name?: string): Field<V> {
return new Field(this.activeFacet.actor.dataflowGraph, initial, name);
}

View File

@ -142,7 +142,7 @@ export abstract class TypedCell<V> extends Cell {
abstract valuesEqual(v1: V, v2: V): boolean;
}
export class Field<V extends Value<T>, T = Ref> extends TypedCell<V> {
export class Field<V> extends TypedCell<V> {
readonly name: string | undefined;
constructor(graph: ObservingGraph<Cell>, initial: V, name?: string) {