Skip to content

Instantly share code, notes, and snippets.

View kulte's full-sized avatar

Zachary Friedman kulte

View GitHub Profile
@kulte
kulte / promise.js
Created December 13, 2013 21:46 — forked from wavded/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'