File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ export function rxloop( config = {} ) {
3131 stream [ `reducer_${ type } $` ] . pipe (
3232 map ( action => {
3333 const rtn = this . createReducer ( action , reducers [ type ] ) ;
34+ action . __source__ = { reducer : type } ;
3435 rtn . __action__ = action ;
3536 return rtn ;
3637 } ) ,
@@ -94,6 +95,7 @@ export function rxloop( config = {} ) {
9495 } ) ;
9596 const rtn = this . createReducer ( action , reducers [ reducer ] ) ;
9697 action . type = `${ name } /${ action . type } ` ;
98+ action . __source__ = { epic : type } ;
9799 rtn . __action__ = action ;
98100 return rtn ;
99101 } ) ,
Original file line number Diff line number Diff line change @@ -313,21 +313,21 @@ describe('Basic api', () => {
313313 expect ( mockfn . mock . calls . length ) . toBe ( 3 ) ;
314314 expect ( mockfn . mock . calls [ 0 ] [ 0 ] ) . toEqual ( {
315315 state : { counter : 1 } ,
316- reducerAction : { type : 'counter/inc' } ,
316+ reducerAction : { type : 'counter/inc' , __source__ : { reducer : 'inc' } } ,
317317 model : 'counter' ,
318318 type : 'plugin' ,
319319 action : 'onStatePatch' ,
320320 } ) ;
321321 expect ( mockfn . mock . calls [ 1 ] [ 0 ] ) . toEqual ( {
322322 state : { counter : 2 } ,
323- reducerAction : { type : 'counter/inc' } ,
323+ reducerAction : { type : 'counter/inc' , __source__ : { reducer : 'inc' } } ,
324324 model : 'counter' ,
325325 type : 'plugin' ,
326326 action : 'onStatePatch' ,
327327 } ) ;
328328 expect ( mockfn . mock . calls [ 2 ] [ 0 ] ) . toEqual ( {
329329 state : { counter : 1 } ,
330- reducerAction : { type : 'counter/dec' } ,
330+ reducerAction : { type : 'counter/dec' , __source__ : { reducer : 'dec' } } ,
331331 model : 'counter' ,
332332 type : 'plugin' ,
333333 action : 'onStatePatch' ,
You can’t perform that action at this time.
0 commit comments