fulfiller
v0.2.2
Published
Always return a Promise
Downloads
3
Readme
fulfiller
$ npm install fulfiller
Utility that makes a function return a Promise. If no function is provided it always returns a resolved Promise.
import fulfiller from 'fulfiller';
(async () => {
const fn = (msg: string) => msg;
const fnPromised = fulfiller(fn);
const result = await fnPromised('hello');
console.log(result); // 'hello'
})();