MCPcopy Create free account
hub / github.com/arctic-cli/interface / create

Function create

packages/arctic/src/util/context.ts:10–24  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

8 }
9
10 export function create<T>(name: string) {
11 const storage = new AsyncLocalStorage<T>()
12 return {
13 use() {
14 const result = storage.getStore()
15 if (!result) {
16 throw new NotFound(name)
17 }
18 return result
19 },
20 provide<R>(value: T, fn: () => R) {
21 return storage.run(value, fn)
22 },
23 }
24 }
25}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected