Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/polkadot/util/promisify.ts>promisify

Package publishing for deno.land/x/polkadot
Go to Latest
function promisify
import { promisify } from "https://deno.land/x/polkadot@0.2.19/util/promisify.ts";

Examples

const { promisify } from '@polkadot/util';

await promisify(null, ((a, cb) => cb(null, a), true); // resolves with `true`
await promisify(null, (cb) => cb(new Error('error!'))); // rejects with `error!`

Type Parameters

optional
R = any

Parameters

self: unknown
fn: (...params: any) => any
...params: any[]

Returns

Promise<R>