summaryrefslogtreecommitdiffhomepage
path: root/packages/cloud/core/src/context.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cloud/core/src/context.ts')
-rw-r--r--packages/cloud/core/src/context.ts21
1 files changed, 0 insertions, 21 deletions
diff --git a/packages/cloud/core/src/context.ts b/packages/cloud/core/src/context.ts
deleted file mode 100644
index c2ca6a313..000000000
--- a/packages/cloud/core/src/context.ts
+++ /dev/null
@@ -1,21 +0,0 @@
-import { AsyncLocalStorage } from "node:async_hooks"
-
-export namespace Context {
- export class NotFound extends Error {}
-
- export function create<T>() {
- const storage = new AsyncLocalStorage<T>()
- return {
- use() {
- const result = storage.getStore()
- if (!result) {
- throw new NotFound()
- }
- return result
- },
- provide<R>(value: T, fn: () => R) {
- return storage.run<R>(value, fn)
- },
- }
- }
-}