tiny + promise = TP
Implement the Promise A+ Spec. But all()
and race
are builted by myself and did not fit the proposed spec.
Same as official Promise
API.
const TP = require('TP');
const tp = new TP((resolve, reject) => {
setTimeout(() => {
resolve('done!');
}, 100);
});
tp.then(res => {
console.log(res) // done!
});