Skip to content
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(frontend): add resetAll to initTransactionsStore #3606

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AntonioVentilii
Copy link
Collaborator

Motivation

Mostly for testing purposes, it is useful to have a way of "resetting" the entire transaction store.

@AntonioVentilii AntonioVentilii requested a review from a team as a code owner November 16, 2024 00:45
@@ -64,6 +65,7 @@ export const initTransactionsStore = <
[tokenId]: null
})),
reset,
resetAll: () => update(() => ({})),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally use null for reset because it explicitly indicates a decision to reset, such as when an error occurs. However, in this case, you are setting to the initial value, which creates a slight discrepancy.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to replicate what is happening for the ETH transactions store too. But for sure I can set null on this, and then, in another PR, I adjust that store too

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say so, makes sense?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to clarify, that means setting null in all keys, like {tokenId1: null, tokenId2: null, ...}, and NOT that the entire store is null instead of {}

correct?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does not reset?

@AntonioVentilii AntonioVentilii marked this pull request as draft November 25, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants