-
Notifications
You must be signed in to change notification settings - Fork 2
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
refactor: store typescript readability improvements #1852
base: production
Are you sure you want to change the base?
refactor: store typescript readability improvements #1852
Conversation
Visit the preview URL for this PR (updated for commit 85b626a): https://emeris-app--pr1852-refactor-store-types-xyotm42t.web.app (expires Wed, 22 Jun 2022 14:13:37 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
@@ -45,10 +33,10 @@ export const module: Module<APIState, RootState> = { | |||
mutations, | |||
getters, | |||
actions, | |||
namespaced: true, | |||
namespaced: 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.
what does that do?
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.
In this case, as it is inside the demeris-api
(alias API) module, is making that all the actions files under demeris-api/actions folder are part of the main API module and not a submodule of the module.
If namespaced is true will be something like Action.API.airdrops.airdropAction
, but if namespaced is false will be Action.API.airdropAction
.
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'm a little confused, the GlobalActionTypes
are deleted now from demeris-api
, but the demeris-user
files are not updated with the new changes?
How they're supposed to call 👇 then 🤔
GlobalActionTypes.API.GET_ALL_BALANCES
I see that you're exporting ActionTypes, but then specifying as GlobalActionTypes
, it's not better to keep always Global in the name?
I could've done that, but thought it was better to split it up to try to keep the PR as small as possible. Happy to refactor that as well?
I deliberately kept the GlobalActionTypes so the rest of the code didn't have to change. Now there is no difference anymore between GlobalActionTypes and ActionTypes. They are the same thing now.
I would suggest the opposite: Calling everything I believe the only reason why we had both was because we namespaced it and simply duplicated code without cleaning it up. I think we can completely get rid of all "Global" stuff, because it doesn't have any meaning. The only thing it "was" is that GlobalActionTypes was namespaced |
If we remove namespacing (which I dont agree with) we need to rename all actions/getters/mutations as current naming is confusing. Tehcnically you can have an action name include the |
@clockworkgr namespacing is not removed - it's still there, it's just ensuring we don't have duplicate namespacing. |
Main fixes:
Demeris API Store:
Many small steps necessary to get to a healthy codebase!