deno.land / x / xstate@xstate@4.33.6 / src / invoke.ts
1234567891011121314151617181920212223242526272829303132export interface InvokedPromiseOptions { id?: string;}
export interface PromiseMachineSchema { states: { pending: {}; resolved: {}; rejected: {}; };}
// export function fromPromise<T>(// promise: Promise<T>,// options?: InvokedPromiseOptions// ): any {// const optionsWithDefaults = {// id: 'promise',// ...options// };
// return Machine<T, PromiseMachineSchema>({// id: optionsWithDefaults.id,// initial: 'pending',// states: {// pending: {},// resolved: {},// rejected: {}// }// });// }
Version Info