Skip to content

Instantly share code, notes, and snippets.

@kandros
Last active August 11, 2016 20:34
Show Gist options
  • Save kandros/74e079f52a9c00d24d4d7f0e29775fec to your computer and use it in GitHub Desktop.
Save kandros/74e079f52a9c00d24d4d7f0e29775fec to your computer and use it in GitHub Desktop.
testing the obvious
function fetchAllProjects() {
return dispatch => {
console.log('1')
dispatch(xxx())
dispatch({ type: 'REQUEST_ALL_PROJECTS' });
console.log('2')
ProjectsApi.getAllProjects()
.then(projects => {
dispatch({ type: 'SUCCESS_ALL_PROJECTS', projects: fromJS(projects) });
})
.catch(e => {
dispatch({ type: 'FAILURE_ALL_PROJECTS' });
console.error(e);
});
};
}
function xxx() {
return dispatch => {
console.log('xxx');
dispatch(rrr());
dispatch(yyy());
dispatch(zzz());
};
}
function yyy() {
console.log('yyy');
return { type:' in yyy'}
}
function zzz() {
return dispatch => {
console.log('zzz')
dispatch(rrr())
}
}
function rrr() {
return dispatch => {
console.log('rrr')
dispatch(qqq())
}
}
function qqq() {
console.log('qqq')
return { type: 'in qqq'}
}
1
xxx
rrr
qqq
yyy
zzz
rrr
qqq
2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment