Skip to content

Instantly share code, notes, and snippets.

🙃
¡Hola!

Oleg Solomka legomushroom

🙃
¡Hola!
Block or report user

Report or block legomushroom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:e9c02c864a42bf5a8a0f91d2e0590dba
export const promiseState = async (p: Promise<any>): Promise<string> => {
const t = {};
return await Promise.race([p, t]).then(
(v) => {
return (v === t)
? 'pending'
: 'fulfilled';
},
() => 'rejected');
};
You can’t perform that action at this time.