Turn.after
This commit is contained in:
parent
33ac308564
commit
04bbcd25ab
|
@ -459,6 +459,15 @@ export class Turn {
|
||||||
if (a !== null) this.enqueue(ref.relay, () => ref.target.message?.(assertion));
|
if (a !== null) this.enqueue(ref.relay, () => ref.target.message?.(assertion));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
after(delayMilliseconds: number, a: LocalAction): any {
|
||||||
|
const facet = this.activeFacet;
|
||||||
|
const release = facet.preventInertCheck();
|
||||||
|
return setTimeout(() => {
|
||||||
|
release();
|
||||||
|
facet.turn(a);
|
||||||
|
}, delayMilliseconds);
|
||||||
|
}
|
||||||
|
|
||||||
enqueue(relay: Facet, a0: LocalAction): void {
|
enqueue(relay: Facet, a0: LocalAction): void {
|
||||||
if (this.queues === null) {
|
if (this.queues === null) {
|
||||||
throw new Error("Attempt to reuse a committed Turn");
|
throw new Error("Attempt to reuse a committed Turn");
|
||||||
|
|
Loading…
Reference in New Issue