-
Notifications
You must be signed in to change notification settings - Fork 18
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): create Storage Setter store #3094
base: main
Are you sure you want to change the base?
feat(frontend): create Storage Setter store #3094
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.
Worth writing a small test too?
|
||
return { | ||
set: ({ key, value }) => { | ||
setStorage({ key, value }); | ||
set(value); | ||
}, | ||
update, |
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 should not leak "update" because a consumer can use it and the value does not get saved in the local storage.
Is there another way?
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 tried without it and it is really not what i would do... basically it uses subscribe
and not in a functional way... let me think a bit and come back on this
|
||
return newState; | ||
}), | ||
resetAll: reset, |
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.
is this correct?
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.
my idea is that resetAll
would reset the entire storage
I can rename it resetStorage
?
Motivation
For the token group store, we need a mix between the
Storage
store and the map provided by theCertified
store. Meaning that we want saved in local storage some thing that isIn this PR we create a new type of
Storage
store that resembles the mapping provided by theCertified
store.