We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 824d91a commit 72aa5ceCopy full SHA for 72aa5ce
README.md
@@ -5,3 +5,16 @@ Allows injecting values from a parent scope into child scopes in async context.
5
```
6
npm i async-context
7
8
+
9
+## example
10
11
+```ts
12
+const { inject, access } = context((): string => "nothing injected");
13
+const withString = inject(() => "injected");
14
15
+const f = () => Promise.resolve(access());
16
17
+await withString(f)(); // "injected"
18
19
+await f(); // "nothing injected"
20
+```
0 commit comments