@w5s/asyncFunctionsdeferdefer Callabledefer<T>(): PromiseWithResolvers<T>Creates a new Promise and returns it in an object, along with its resolve and reject functions.@examplefunction sayHelloWorld(ms: number): Promise<string> { const { promise, resolve, reject } = defer<string>(); setTimeout(() => resolve('Hello world'), ms); return promise;}Type parametersT
Creates a new Promise and returns it in an object, along with its resolve and reject functions.