# Function promiseWithResolvers

- promiseWithResolvers<T>(): {
  promise: Promise<T>;
  reject: (reason?: any) => void;
  resolve: (value: T | PromiseLike<T>) => void;
  }

  Polyfill for Promise.withResolvers().

  This is specifically for Cloudflare Workers. Their implementation of Promise.withResolvers does not work correctly.

  #### Type Parameters

  - T

  #### Returns {
  promise: Promise<T>;
  reject: (reason?: any) => void;
  resolve: (value: T | PromiseLike<T>) => void;
  }

  - Defined in rivetkit-typescript/packages/rivetkit/src/utils.ts:97