Skip to content

Instantly share code, notes, and snippets.

@s-panferov
Created Mar 11, 2015
Embed
What would you like to do?
API
private dispatchLoadOrgs(action: org_actions.LoadOrgs.Start) {
loadOrgsLock.lock(action.actionId, api.requestManager);
org_api.OrgApi
.loadOrgs(action.actionId)
.then((reply) => {
loadOrgsLock.unlock();
this.dispatcher.dispatch(new org_actions.LoadOrgs.Complete(action, reply.orgs))
})
.catch((e) => {
console.error(e);
loadOrgsLock.unlock();
this.dispatcher.dispatch(new org_actions.LoadOrgs.Fail(action))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment