Created
March 25, 2015 08:16
-
-
Save jstclair/60a8b4a7c9f3cb693507 to your computer and use it in GitHub Desktop.
analytics-in-flux
This file contains hidden or 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
loadOneAction(context, payload, done) { | |
//NOTE: This really requires a check that loadAll has completed. | |
// So something like context.ensure('LOAD_BOOKPILES_SUCCESS')... | |
//NOTE: called from the router, so route info is passed on .params | |
return loadData(function(err) { | |
console.log(err); | |
context.dispatch('LOAD_BOOKPILES_ERROR', {}); | |
return done(err); | |
}, function(res) { | |
context.dispatch('LOAD_BOOKPILES_SUCCESS', res.body); | |
context.dispatch('SHOW_PILE', payload.params); // userid, pileid | |
if (IS_CLIENT) { | |
analytics.page(payload.params.pileid); | |
} | |
return done(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment