This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (result.done) { | |
return result.value; | |
} else { | |
return RSVP.Promise.resolve(result.value).then(callback, errback); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return RSVP.Promise.resolve(result.value).then(callback, errback); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function continuer(verb, arg) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result = generator[verb](arg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.users = yield getJSON('/users'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
self.users = yield getJSON('/users'); | |
self.contacts = yield getJSON('/contacts'); | |
self.companies = yield getJSON('/companies'); | |
return self; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (result.done) { | |
return result.value; | |
} else { | |
return RSVP.Promise.resolve(result.value).then(callback, errback); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var self = this; | |
return getJSON('/login').then(function(auth) { | |
self.auth = auth; | |
return getJSON('/users'); | |
}).then(function(users) { | |
self.users = users; | |
return getJSON('/contacts'); |