@equilab/service

1.3.5 • Public • Published

EQ Utils

Convenience Types

  • type Undef<T> = T | undefined;
  • type Unwrap<T> = T extends Undef<infer D> ? D : T;
  • type UnwrapArray<T> = T extends Array<infer D> ? D : T;
  • type UnwrapPromise<T> = T extends Promise<infer D> ? D : T;

Async helpers

  • Mutex
  export { Mutex } from "@equilab/utils";

  const mutex = new Mutex();

  const release = await mutex.acquire(); // if mutex is acquired by another task then pause execution

  release(); // release mutex to let it be acquired

Readme

Keywords

none

Package Sidebar

Install

npm i @equilab/service

Weekly Downloads

94

Version

1.3.5

License

none

Unpacked Size

459 kB

Total Files

190

Last publish

Collaborators

  • itsyrulnikov
  • eosdtadmin