@@ -9,10 +9,11 @@ window.devToolsExtension = function(next) {
99 let shouldInit = true ;
1010 let actionsCount = 0 ;
1111
12- function relay ( type , state , action ) {
12+ function relay ( type , state , action , nextActionId ) {
1313 const message = {
1414 payload : state ,
1515 action : action || '' ,
16+ nextActionId : nextActionId || '' ,
1617 type : type ,
1718 source : 'redux-page' ,
1819 init : shouldInit
@@ -59,23 +60,31 @@ window.devToolsExtension = function(next) {
5960 ) ;
6061 }
6162
63+ function addFilter ( state ) {
64+ if ( window . devToolsOptions . filter ) {
65+ const { whitelist, blacklist } = window . devToolsOptions ;
66+ state . filter = { whitelist, blacklist } ;
67+ }
68+ }
69+
6270 function isLimit ( ) {
6371 if ( window . devToolsOptions . limit && actionsCount > window . devToolsOptions . limit ) {
6472 store . liftedStore . dispatch ( { type : 'COMMIT' , timestamp : Date . now ( ) } ) ;
6573 return true ;
6674 }
67- actionsCount ++ ;
6875 return false ;
6976 }
7077
7178 function subscriber ( state = { } , action ) {
7279 if ( action && action . type ) {
7380 setTimeout ( ( ) => {
7481 if ( action . type === 'PERFORM_ACTION' ) {
82+ actionsCount ++ ;
7583 if ( isLimit ( ) || isFiltered ( action . action ) ) return state ;
76- relay ( 'ACTION' , store . getState ( ) , action ) ;
84+ relay ( 'ACTION' , store . getState ( ) , action , actionsCount ) ;
7785 } else {
78- const liftedState = store . liftedStore . getState ( ) ;
86+ let liftedState = store . liftedStore . getState ( ) ;
87+ addFilter ( liftedState ) ;
7988 relay ( 'STATE' , liftedState ) ;
8089 actionsCount = liftedState . nextActionId ;
8190 }
0 commit comments