Attributes
Includes Deno configuration
Repository
Current version released
7 months ago
Dependencies
deno.land/x
Versions
Inject values from a parent scope into child scopes in async context.
node:
npm i async-context
deno:
import { context } from "https://deno.land/x/context_inject/src/index.ts";
example
const { inject, access } = context((): string => "nothing injected");
const withString = inject(() => "injected");
const f = () => Promise.resolve(access());
await withString(f)(); // "injected"
await f(); // "nothing injected"