@wry/context

  • Version 0.6.0
  • Published
  • 56.2 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_2>(
callback: (...args: TArgs_1) => TResult_2
): (...args: TArgs_1) => TResult_2;
noContext<TResult_3, TArgs_2 extends any[], TThis_1 = any>(
callback: (this: TThis_1, ...args: TArgs_2) => TResult_3,
args?: TArgs_2,
thisArg?: TThis_1
): TResult_3;
};

    Functions

    function asyncFromGen

    asyncFromGen: <TArgs extends any[]>(
    genFn: (...args: TArgs) => any
    ) => (...args: TArgs) => Promise<any>;

      function bind

      bind: <TArgs extends any[], TResult>(
      callback: (...args: TArgs) => TResult
      ) => (...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>