thefrontside / effection

Structured concurrency and effects for JavaScript
https://frontside.com/effection
MIT License
592 stars 25 forks source link

add `withResolvers()` utility to be the analog of `Promise.withResolvers()` #900

Open cowboyd opened 5 months ago

cowboyd commented 5 months ago
export interface WithResolvers<T> {
  operation: Operation<T>;
  resolve(value: T): void;
  reject(error: Error): void;
}

export declare function withResolvers<T>(): WithResolvers<T>;