Skip to content

Instantly share code, notes, and snippets.

View dagda1's full-sized avatar

Paul dagda1

View GitHub Profile
if (result.done) {
return result.value;
} else {
return RSVP.Promise.resolve(result.value).then(callback, errback);
}
return RSVP.Promise.resolve(result.value).then(callback, errback);
function continuer(verb, arg) {
result = generator[verb](arg);
self.users = yield getJSON('/users');
self.users = yield getJSON('/users');
self.contacts = yield getJSON('/contacts');
self.companies = yield getJSON('/companies');
return self;
if (result.done) {
return result.value;
} else {
return RSVP.Promise.resolve(result.value).then(callback, errback);
}
var Person = function(name) {
this.name = name;
};
var sayHello = function() {
console.log("Hello, my name is " + this.name);
};
var bob = new Person('Bob');
var paul = new Person('Paul');
@dagda1
dagda1 / bind.js
Last active August 29, 2015 13:57
var Person = function(name) {
this.name = name;
};
var sayHello = function() {
console.log("Hello, my name is " + this.name);
};
var bob = new Person('Bob');
var paul = new Person('Paul');
@dagda1
dagda1 / chain.js
Last active August 29, 2015 13:57
var self = this;
return getJSON('/login').then(function(auth) {
self.auth = auth;
return getJSON('/users');
}).then(function(users) {
self.users = users;
return getJSON('/contacts');