Skip to main content
Module

x/polkadot/mod.ts>util.promisify

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

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>