diff options
author | bobzel <zzzman@gmail.com> | 2022-03-07 12:14:39 -0500 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2022-03-07 12:14:39 -0500 |
commit | c21919a2105bd1ed4f060be149624d064739a36c (patch) | |
tree | e88bbc4db244a08bd759e2985a31593a4b521911 /src/fields/List.ts | |
parent | 7fa30c3edd851cc42cb68063d9dbdd7335fe7370 (diff) |
got rid of include cycles for Scripting globals to make hot updates work better.
Diffstat (limited to 'src/fields/List.ts')
-rw-r--r-- | src/fields/List.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fields/List.ts b/src/fields/List.ts index 93a8d1d60..60bf442d4 100644 --- a/src/fields/List.ts +++ b/src/fields/List.ts @@ -1,7 +1,7 @@ import { action, observable } from "mobx"; import { alias, list, serializable } from "serializr"; import { DocServer } from "../client/DocServer"; -import { Scripting } from "../client/util/Scripting"; +import { ScriptingGlobals } from "../client/util/ScriptingGlobals"; import { afterDocDeserialize, autoObject, Deserializable } from "../client/util/SerializationHelper"; import { Field } from "./Doc"; import { Copy, OnUpdate, Parent, Self, SelfProxy, ToScriptString, ToString, Update } from "./FieldSymbols"; @@ -327,8 +327,8 @@ class ListImpl<T extends Field> extends ObjectField { export type List<T extends Field> = ListImpl<T> & (T | (T extends RefField ? Promise<T> : never))[]; export const List: { new <T extends Field>(fields?: T[]): List<T> } = ListImpl as any; -Scripting.addGlobal("List", List); -Scripting.addGlobal(function compareLists(l1: any, l2: any) { +ScriptingGlobals.add("List", List); +ScriptingGlobals.add(function compareLists(l1: any, l2: any) { const L1 = Cast(l1, listSpec("string"), []); const L2 = Cast(l2, listSpec("string"), []); return !L1 && !L2 ? true : L1 && L2 && L1.length === L2.length && L2.reduce((p, v) => p && L1.includes(v), true); |