From c9aab425fe4fc2f0f940ea5458cb4b492496dd6f Mon Sep 17 00:00:00 2001 From: Tony Garnock-Jones Date: Sun, 7 Jan 2024 13:02:01 +0100 Subject: [PATCH] Facet.wrap --- packages/core/src/runtime/actor.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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); }