Skip to content

Instantly share code, notes, and snippets.

Avatar

Zachary Friedman kulte

View GitHub Profile
View promise.js
"use strict"
var Promise = function () {
this.state = 'pending'
this.thenables = []
}
Promise.prototype.resolve = function (value) {
if (this.state != 'pending') return
this.state = 'fulfilled'
You can’t perform that action at this time.