diff --git a/packages/core/src/runtime/actor.ts b/packages/core/src/runtime/actor.ts index 6c013eb..2f4d5ff 100644 --- a/packages/core/src/runtime/actor.ts +++ b/packages/core/src/runtime/actor.ts @@ -1,7 +1,7 @@ /// SPDX-License-Identifier: GPL-3.0-or-later /// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones -import { IdentitySet, Value, embeddedId, is, fromJS, stringify, Dictionary, KeyedSet } from '@preserves/core'; +import { IdentitySet, Value, embeddedId, is, fromJS, stringify, Dictionary, KeyedSet, Tuple } from '@preserves/core'; import { Cell, Field, Graph } from './dataflow.js'; import { Caveat, runRewrites } from './rewrite.js'; import { ActorSpace } from './space.js'; @@ -181,6 +181,10 @@ export class Facet { this.outbound = initialAssertions; } + wrap>(f: (... args: T) => void): (... args: T) => void { + return (... args) => this.turn(() => f(... args)); + } + turn(a: LocalAction) { Turn.for(this, a); }