diff options
Diffstat (limited to 'packages/app/src/context/global-sync')
| -rw-r--r-- | packages/app/src/context/global-sync/child-store.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/app/src/context/global-sync/child-store.ts b/packages/app/src/context/global-sync/child-store.ts index d5904c609..70668350e 100644 --- a/packages/app/src/context/global-sync/child-store.ts +++ b/packages/app/src/context/global-sync/child-store.ts @@ -226,6 +226,15 @@ export function createChildStoreManager(input: { return childStore } + function peek(directory: string, options: ChildOptions = {}) { + const childStore = ensureChild(directory) + const shouldBootstrap = options.bootstrap ?? true + if (shouldBootstrap && childStore[0].status === "loading") { + input.onBootstrap(directory) + } + return childStore + } + function projectMeta(directory: string, patch: ProjectMeta) { const [store, setStore] = ensureChild(directory) const cached = metaCache.get(directory) @@ -256,6 +265,7 @@ export function createChildStoreManager(input: { children, ensureChild, child, + peek, projectMeta, projectIcon, mark, |
