Skip to content

v0.4.7

Compare
Choose a tag to compare
@zalmoxisus zalmoxisus released this 31 Aug 08:17
· 85 commits to master since this release

New options to sanitize states and actions:

  • stateSanitizer - function which takes state object and index as arguments, and should return state object back.
  • actionSanitizer - function which takes action object and id number as arguments, and should return action object back.

Example of usage:

export default function configureStore(initialState) {
  // Note: passing enhancer as last argument requires redux@>=3.1.0
  const store = createStore(
    rootReducer,
    initialState,
    devTools({
      actionSanitizer: (action) => (
       action.type === 'FILE_DOWNLOAD_SUCCESS' && action.data ?
       { ...action, data: '<<LONG_BLOB>>' } : action
      ),
      stateSanitizer: (state) => state.data ? { ...state, data: '<<LONG_BLOB>>' } : state
    })
  );
  return store;
}

Downgraded socketcluster-client to fix Windows issues.