@@ -43,6 +43,37 @@ function parentAsyncActionCreator() {
4343 } ;
4444}
4545
46+ const anotherAsyncStart = ( ) => { return { type : 'another-test-action-start' } ; } ;
47+ const anotherAsyncFinish = ( ) => { return { type : 'another-test-action-finish' } ; } ;
48+ const anotherAsyncFail = ( ) => { return { type : 'another-test-action-fail' } ; } ;
49+
50+ function anotherAsyncActionCreator ( ) {
51+ return dispatch => {
52+ dispatch ( anotherAsyncStart ( ) ) ;
53+ return asyncFunction ( ) . then ( ( ) => {
54+ dispatch ( anotherAsyncFinish ( ) ) ;
55+ } ) . catch ( ( ) => {
56+ dispatch ( anotherAsyncFail ( ) ) ;
57+ } ) ;
58+ } ;
59+ }
60+
61+ const anotherParentAsyncStart = ( ) => { return { type : 'another-parent-test-action-start' } ; } ;
62+ const anotherParentAsyncFinish = ( ) => { return { type : 'another-parent-test-action-finish' } ; } ;
63+ const anotherParentAsyncFail = ( ) => { return { type : 'another-parent-test-action-fail' } ; } ;
64+
65+ function anotherParentAsyncActionCreator ( ) {
66+ return dispatch => {
67+ dispatch ( anotherParentAsyncStart ( ) ) ;
68+ return asyncFunction ( ) . then ( ( ) => {
69+ dispatch ( anotherAsyncActionCreator ( ) ) ;
70+ dispatch ( anotherParentAsyncFinish ( ) ) ;
71+ } , ( ) => {
72+ dispatch ( anotherParentAsyncFail ( ) ) ;
73+ } ) ;
74+ } ;
75+ }
76+
4677const expectedActions = [
4778 start ( ) ,
4879 anotherStart ( ) ,
@@ -55,6 +86,19 @@ const expectedParentActions = [
5586 parentFinish ( )
5687] ;
5788
89+
90+ const anotherExpectedActions = [
91+ anotherAsyncStart ( ) ,
92+ anotherAsyncFinish ( )
93+ ] ;
94+
95+ const anotherParentExpectedActions = [
96+ anotherParentAsyncStart ( ) ,
97+ anotherAsyncActionCreator ( ) ,
98+ anotherParentAsyncFail ( )
99+ ] ;
100+
101+
58102export default {
59103 start,
60104 anotherStart,
@@ -68,5 +112,9 @@ export default {
68112 parentFail,
69113 parentAsyncActionCreator,
70114 expectedActions,
71- expectedParentActions
115+ expectedParentActions,
116+ anotherAsyncActionCreator,
117+ anotherParentAsyncActionCreator,
118+ anotherExpectedActions,
119+ anotherParentExpectedActions
72120} ;
0 commit comments