Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 1007 Bytes

binded.md

File metadata and controls

50 lines (32 loc) · 1007 Bytes

binded functions on Promise

There are weird design that functions on Promise cannot designed as methods and cannot call without Promise as context. We bind them to Promise, so you can treat them as normal functions.

Usage

import 'https://better-js.fenz.land/src/promise/binded.js';

const { resolve, reject, all, race, }= Promise;

resolve( value, );
reject( reason, );
all( [ ...promise, ...values, ], );
race( [ ...promise, ...values, ], );
import 'https://better-js.fenz.land/src/promise/better-allSettled.js';

const { allSettled, }= Promise;

allSettled( [ ...promise, ...values, ], );
import 'https://better-js.fenz.land/src/promise/any.js';

const { any, }= Promise;

any( [ ...promise, ...values, ], );
import 'https://better-js.fenz.land/src/promise/make.js';

const { make, }= Promise;

make();
import 'https://better-js.fenz.land/src/promise/try.js';

const { try:_try, }= Promise;

_try();