Skip to content

Instantly share code, notes, and snippets.

View zeffgo's full-sized avatar

Serge S zeffgo

View GitHub Profile
@zeffgo
zeffgo / Promise.js
Created April 3, 2019 13:39
Simple Promise implementation in Node
class Promise {
constructor(fn) {
this.thens = [];
this.state = 'pending';
this.value = undefined;
fn(this.resolve.bind(this));
return this;
}