Last active
August 29, 2015 14:16
-
-
Save goatslacker/a71c96f458ac3d3b5e47 to your computer and use it in GitHub Desktop.
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 Alt = require('alt'); | |
var alt = new Alt(); | |
function Actions() { } | |
Actions.prototype.fetchSomething = function () { | |
return new Promise(function (resolve, reject) { | |
setTimeout(function () { | |
this.dispatch('value'); | |
resolve('value'); | |
}.bind(this), 100); | |
}.bind(this)); | |
} | |
var actions = alt.createActions(Actions); | |
// not really fire and forget, but possible. | |
actions.fetchSomething().then(function (x) { | |
// do something with x? | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment