diff options
author | bobzel <zzzman@gmail.com> | 2020-10-10 20:24:41 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2020-10-10 20:24:41 -0400 |
commit | c63aeeb0010a79f0b19d8719f97d98b7a83baf3b (patch) | |
tree | 06f3033fe74586d59a6998173899e38bca043059 /src/client/util/SnappingManager.ts | |
parent | c03949832eaff9c29fe48f8ec702362810c7f3b6 (diff) |
cached groups user is in for efficiency which avoids th whole screen redrawing when a group is added.
Diffstat (limited to 'src/client/util/SnappingManager.ts')
-rw-r--r-- | src/client/util/SnappingManager.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/client/util/SnappingManager.ts b/src/client/util/SnappingManager.ts index d067dff6c..a615f0247 100644 --- a/src/client/util/SnappingManager.ts +++ b/src/client/util/SnappingManager.ts @@ -1,4 +1,5 @@ import { observable, action, runInAction } from "mobx"; +import { computedFn } from "mobx-utils"; export namespace SnappingManager { @@ -32,6 +33,8 @@ export namespace SnappingManager { /// bcz; argh!! TODO; These do not belong here, but there were include order problems with leaving them in util.ts // need to investigate further what caused the mobx update problems and move to a better location. export function SetCachedGroups(groups: string[]) { manager.setCachedGroups(groups); } - export function GetCachedGroups() { return manager.cachedGroups; } + export function GetCachedGroupByName(name: string) { + return computedFn(function (name: string) { return manager.cachedGroups.includes(name); }, true)(name); + } } |