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

x/polkadot/util/mod.ts>promisify

Package publishing for deno.land/x/polkadot
Go to Latest
function promisify
import { promisify } from "https://deno.land/x/polkadot@0.2.17/util/mod.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>