Skip to content

Instantly share code, notes, and snippets.

View nygardk's full-sized avatar

Klaus Nygård nygardk

View GitHub Profile
import AppDispatcher from 'AppDispatcher';
import when from 'when';
function asyncDispatch(actionType, promise, actionObj = {}) {
AppDispatcher.handleViewAction({
type: actionType.LOADING
});
return promise.then(response => {
AppDispatcher.handleViewAction({...{