-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Remove mutation tracking from the store #1846
Conversation
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 think we could better encapsulate mutationStore
, but other than that this looks like a good change!
src/core/QueryManager.ts
Outdated
@@ -308,6 +334,9 @@ export class QueryManager { | |||
mutationId, | |||
}); | |||
|
|||
this.mutationStore[mutationId].loading = false; |
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.
Instead of updating these store items directly, can we make the mutation store a class and have methods for each of these situations? Then we can operate on a slightly higher level of abstraction and call something like this.mutationStore.saveMutationError(mutationId, error)
(similar to the actions we used to dispatch)
Also, I think this means we don't need the mutation-related Redux actions anymore, right? I guess we should leave them back in for better backwards compatibility?
src/core/QueryManager.ts
Outdated
update: updateWithProxyFn, | ||
}); | ||
|
||
this.mutationStore[mutationId].loading = false; |
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.
Same as above, let's wrap these in some kind of method on mutationStore
aea2442
to
c977370
Compare
c977370
to
d0ec3d4
Compare
@jbaxleyiii this is a change we want to be really careful with, since it will definitely break something. For example this will break mutations in the dev tools as is since that currently reads from the store. |
Can we open an issue to make sure to clean up old mutations? Right now they all stick around forever (not a regression, just a pre-existing issue). |
2c739db
to
3e81ea4
Compare
fd1017d
to
db5d7a2
Compare
1e6e7e2
to
e0a93dc
Compare
e0a93dc
to
05f1aaa
Compare
TODO: