@rainder/defer
v1.0.0
Published
Simple promise wrapper
Downloads
6
Readme
Defer
Simple Native node.js promise wrapper.
defer(): dfd
import { defer } from '@rainder/defer';
const dfd = defer<number>();
dfd.promise.then(...);
dfd.resolve(...);
dfd.reject(...);
defer.callback(fn: Function): Promise
import { callback } from '@rainder/defer';
callback<Socket>((cb) => {
socket.write(data, cb);
}).then(...);
That's it.