ref-once-init
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

ref-once-init

npm gzip size

🗼 Let Promise Function Executed Only Once.

The Promise will be executed when the attribute target is called for the first time, and the Promise executed will not be executed again when called repeatedly.

The same Promise will not be executed twice at the same time. Only the first one will be executed, while the rest can still get the result of the promise after executed.

If you are looking for the pure version of once-init(without ref), click me 国内镜像

Once init Promise

  1. The Promise Function packaged by RefOnceInit will never be executed twice at the same time
  2. If A Promise Function is called before previous Promise Function resolved, It will share the response of the previous one.

Install

Install by package management tools, pnpm is recommended;

npm install ref-once-init

OR

yarn add ref-once-init

OR

pnpm add ref-once-init

Usage

For example, use ref-once-init with axios;

Package Sidebar

Install

npm i ref-once-init

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

15.8 kB

Total Files

10

Last publish

Collaborators

  • xmon