Facet.wrap
This commit is contained in:
parent
46bafa9501
commit
c9aab425fe
|
@ -1,7 +1,7 @@
|
|||
/// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
/// SPDX-FileCopyrightText: Copyright © 2016-2023 Tony Garnock-Jones <tonyg@leastfixedpoint.com>
|
||||
|
||||
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<T extends Tuple<any>>(f: (... args: T) => void): (... args: T) => void {
|
||||
return (... args) => this.turn(() => f(... args));
|
||||
}
|
||||
|
||||
turn(a: LocalAction) {
|
||||
Turn.for(this, a);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue