-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
Add ignoredPaths option to ignore serializability check #320
Conversation
Deploy preview for redux-starter-kit-docs ready! Built with commit ee11ed7 https://deploy-preview-320--redux-starter-kit-docs.netlify.com |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit ee11ed7:
|
Can we try doing |
@markerikson Sure! But I'm wondering what's the use case for making just part of the slices ignored for checking serializability? From my understanding, it should mainly comes from an uncontrolled third-party library which is also rare. I'm open to both solutions though, I'll make the change later :) |
|
I'm mostly just looking for a granularity thing here. |
Updated! Thx @markerikson @phryneas ❤️ Do we want to also support passing array of array here? even though dot-separated path is quite common. const serializableStateInvariantMiddleware = createSerializableStateInvariantMiddleware(
{
ignoredPaths: [["testSlice", "a"], ["testSlice", "b", "c"]]
}
); |
Hm. I believe once we allow for array notation there, people are gonna assume that we have TS support for that (which I wouldn't want to add here as it's too much complication for a niche use case), so I'd stick with dot notation only. |
Great, thanks! |
Is anyone working on updating the documentation for this? I may have just volunteered... |
Hmm. Yeah, I missed that the doc update was only for the "other exports" page, and we should mention something about this on the |
Oops, I didn't know that there is documentation for this in that page. Maybe a link point to the `other exports" page would be fine? |
Mmm... let's at least update the type signature in the |
Yeah, I know I made some CSS tweaks to the Redux core repo to make sure links in code snippets are actually colored. Probably ought to pull those over. |
PR opened: #327 |
Fix #319
Add a new option to
createSerializableStateInvariantMiddleware
calledignoredPaths
. It accepts an array of dot-separated path strings to be ignored when checking for serializability in state.