Skip to content

Instantly share code, notes, and snippets.

This file has been truncated, but you can view the full file.
(function(){
/*!*************************************************************
*
* Firebug Lite 1.4.0a1
*
* Copyright (c) 2007, Parakey Inc.
* Released under BSD license.
* More information: http://getfirebug.com/firebuglite
*
@chowey
chowey / withResolvers.polyfill.ts
Created July 14, 2024 19:34
Promise.withResolvers polyfill
Promise.withResolvers ??
(Promise.withResolvers = function withResolvers<T>() {
let a: (value: T | PromiseLike<T>) => void;
let b: (reason?: unknown) => void;
const c = new this<T>(function (resolve, reject) {
a = resolve;
b = reject;
});
return { resolve: a!, reject: b!, promise: c };
});