Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

402 B
Raw Blame
interface MockPromise<T> {
    promise: Promise<T>
    resolve: (value?: any) => void
    reject: (error: any) => void
}

export function createPromise<T = void>(): MockPromise<T> {
    const result: Partial<MockPromise<T>> = {}
    result.promise = new Promise<T>((_resolve, _reject) => {
        result.resolve = _resolve
        result.reject = _reject
    })

    return result as MockPromise<T>
}