@wry/context

  • Version 0.7.4
  • Published
  • 76.8 kB
  • 1 dependency
  • MIT license

Install

npm i @wry/context
yarn add @wry/context
pnpm add @wry/context

Overview

Manage contextual information needed by (a)synchronous tasks without explicitly passing objects around

Index

Variables

variable Slot

const Slot: {
new <TValue>(): {
readonly id: string;
hasValue(): boolean;
getValue(): TValue;
withValue<TResult, TArgs extends any[], TThis = any>(
value: TValue,
callback: (this: TThis, ...args: TArgs) => TResult,
args?: TArgs,
thisArg?: TThis
): TResult;
};
bind<TArgs_1 extends any[], TResult_1, TThis_1 = any>(
callback: (this: TThis_1, ...args: TArgs_1) => TResult_1
): (this: TThis_1, ...args: TArgs_1) => TResult_1;
noContext<TResult_2, TArgs_2 extends any[], TThis_2 = any>(
callback: (this: TThis_2, ...args: TArgs_2) => TResult_2,
args?: TArgs_2,
thisArg?: TThis_2
): TResult_2;
};

    Functions

    function asyncFromGen

    asyncFromGen: <TArgs extends any[], TYield = any, TReturn = any, TNext = any>(
    genFn: (...args: TArgs) => Generator<TYield, TReturn, TNext>
    ) => (...args: TArgs) => Promise<any>;

      function bind

      bind: <TArgs extends any[], TResult, TThis = any>(
      callback: (this: TThis, ...args: TArgs) => TResult
      ) => (this: TThis, ...args: TArgs) => TResult;

        function noContext

        noContext: <TResult, TArgs extends any[], TThis = any>(
        callback: (this: TThis, ...args: TArgs) => TResult,
        args?: TArgs,
        thisArg?: TThis
        ) => TResult;

          function setTimeout

          setTimeout: (callback: () => any, delay: number) => any;

            function wrapYieldingFiberMethods

            wrapYieldingFiberMethods: <F extends Function>(Fiber: F) => F;

              Package Files (2)

              Dependencies (1)

              Dev Dependencies (0)

              No dev dependencies.

              Peer Dependencies (0)

              No peer dependencies.

              Badge

              To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

              You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@wry/context.

              • Markdown
                [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@wry/context)
              • HTML
                <a href="https://www.jsdocs.io/package/@wry/context"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>