Skip to content

Instantly share code, notes, and snippets.

@ekryski
Created April 6, 2015 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ekryski/7f54f37aa74f70fea1fe to your computer and use it in GitHub Desktop.
Save ekryski/7f54f37aa74f70fea1fe to your computer and use it in GitHub Desktop.
Async Flux
var AppConstants = require('../constants/constants');
var AppDispatcher = require('../dispatchers/app');
var Connections = require('../api/connection');
var ConnectionActions = {
loadConnections: function() {
Connections.find({}, function(error, connections){
if (error) {
AppDispatcher.handleViewAction({
action: AppConstants.LOAD_CONNECTIONS_FAIL,
error: error
});
}
else {
AppDispatcher.handleViewAction({
action: AppConstants.LOAD_CONNECTIONS_SUCCESS,
connections: connections
});
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment