UNPKG

@graphql-tools/utils

Version:

Common package containing utils and types for GraphQL tools

13 lines (12 loc) 309 B
export function createDeferred() { if (Promise.withResolvers) { return Promise.withResolvers(); } let resolve; let reject; const promise = new Promise((_resolve, _reject) => { resolve = _resolve; reject = _reject; }); return { promise, resolve, reject }; }