-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(StoreDevtools): Add support for ActionSanitizer and StateSanitizer #795
Conversation
* Restructures the lifted state passed in to prepare for sending to the | ||
* Redux Devtools Extension | ||
*/ | ||
getSanitizedState(state: LiftedState, config: Partial<StoreDevtoolsConfig>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass the stateSanitizer
as an argument instead of the config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change
@brandonroberts Thank you! Fixed as requested. |
Thanks! |
Any chance of a patch release so I can use this? |
Continuing the work from #544 and requested by #604, this PR actually adds the sanitization functionality to @ngrx/store-devtools.
Unfortunately, simply passing
actionSanitizer
andstateSanitizer
to the Redux Devtools Extension does not work, since thesend(action, state)
function exposed by its API does not sanitize anything if theaction
passed in isnull
, which is the current behaviour. As a result, it is necessary to sanitize within ngrx Devtools itself, and then pass that into the extension.This implementation deliberately avoids mutating the lifted state's
actionsByIds
andcomputedStates
properties, but instead creates a sanitized copy of them. This prevents the possibility of a sanitized action from changing the store state if, for example, its sanitized type coincided with a real action's type within the application.Testing
In
app.module.ts
:Open Chrome, confirm that it appears, while app and time travel seem to work fine.