@equilab/service
v1.3.5
Published
## 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;`
Downloads
134
Readme
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