-
-
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
Allow custom serializer #1121
Allow custom serializer #1121
Conversation
@@ -60,7 +60,7 @@ export function createConfig( | |||
actionSanitizer: undefined, | |||
stateSanitizer: undefined, | |||
name: DEFAULT_NAME, | |||
serialize: false, | |||
serialize: undefined, |
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.
This potentially would be a breaking change, since the existing behavior is to handle circular references. We should have changed with the default serializer for router-store.
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.
As far as I can tell, undefined
is recommended default (will use regular JSON.stringify to send data, and it's the fasted mode).
There are concerns that attempting to resolve circular references with JSPB might crash the extension.
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.
👍
modules/store-devtools/src/config.ts
Outdated
@@ -3,14 +3,21 @@ import { InjectionToken, Type } from '@angular/core'; | |||
|
|||
export type ActionSanitizer = (action: Action, id: number) => Action; | |||
export type StateSanitizer = (state: any, index: number) => any; | |||
export type SerializeOptions = { |
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.
I'd prefer SerializationOptions
here
Renamed to |
I think we should leave it as |
Done |
Thanks Alex! |
serialize
can be boolean or object. One of the teams needs to provide custom replacer.Adjusting the
serialize
according to the docs for extension:https://github.com/zalmoxisus/redux-devtools-extension/blob/master/docs/API/Arguments.md#serialize