-
Notifications
You must be signed in to change notification settings - Fork 39
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
[HUM-132]: chore: separate homepage state hook from context #3005
[HUM-132]: chore: separate homepage state hook from context #3005
Conversation
@mpblocky is attempting to deploy a commit to the HUMAN Protocol Team on Vercel. A member of the Team first needs to authorize it. |
packages/apps/human-app/frontend/src/shared/types/homepage-state.ts
Outdated
Show resolved
Hide resolved
@dnechay PR ready! |
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.
Nice optimization of context with useMemo
Do we really need to move useHomePageState
to shared/hooks
? IMO it will only clutter shared/hooks
folder.
I would suggest to have shared/contexts/homepage-state
folder with internal files like:
homepage-state.ts
types.ts
(seems to be excessive for now,HomePageStateType
can be places in context file itself because not used anywhere else so there is no need to even export it)use-homepage-state.ts
- hookindex.ts
- from where you re-export hook and context
wdyt?
@dnechay I'm not sure about keeping hook in there; do You want to keep context hooks near the context and some more general hooks in |
Yes: IMO it's cleaner for our use case, because we don't have many different contexts that we use at the same time in different components and if we co-locate these hooks near to their contexts - it's easier to find things. In case you anticipate there might be some complex use-cases - then I would keep them in I believe it's better to keep things simple and straightforward till the moment you actually see there is a complex use-case and you need to refactor for it As an example of a "complex" use case: you might want to have some
|
@dnechay yes, this sounds good, just wanted to be sure we are on the same page :) |
@dnechay fixed :) |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Issue tracking
HUM-132
Context behind the change
How has this been tested?
Release plan
normal deploy
Potential risks; What to monitor; Rollback plan
N/A