mirror of
https://github.com/cypress-io/cypress.git
synced 2026-01-26 08:59:03 -06:00
18 lines
355 B
TypeScript
18 lines
355 B
TypeScript
import * as Promise from 'bluebird'
|
|
|
|
export function createDeferred<T> () {
|
|
let resolve: (thenableOrResult?: T | PromiseLike<T> | undefined) => void
|
|
let reject: any
|
|
const promise = new Promise<T>(function (_resolve, _reject) {
|
|
resolve = _resolve
|
|
reject = _reject
|
|
})
|
|
|
|
return {
|
|
//@ts-ignore
|
|
resolve,
|
|
reject,
|
|
promise,
|
|
}
|
|
}
|