Skip to content

Passing non-serializable blobs to async thunk payload creators: best practices? #5040

Answered by markerikson
wchargin asked this question in Q&A
Discussion options

You must be logged in to vote

Yeah, RTK's serializability middleware does already default to ignoring that action path specifically for this reason:

ignoredActionPaths = ['meta.arg', 'meta.baseQueryMeta'],

As you noted, it doesn't get serialized across to the devtools, so in a sense that's "broken"... but it's also not realistically likely that you needed to inspect the blob in the devtools anyway. Also, as much as we've always tried to keep actions serializable to enable the time travel debugging aspects, in practice few people make use of that. So, if you do end up passing non-serializable values as a thunk arg, it's not the end of the world, and we tweaked the serializability middleware to account for that.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by wchargin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants