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

Palette reload after auth #227

Merged
merged 3 commits into from
Apr 25, 2024
Merged

Conversation

bhujoshi
Copy link
Collaborator

@bhujoshi bhujoshi commented Apr 25, 2024

  • Refactored all the application states to Zustand. This is required because the hook use to change the reference of action functions(Ex loadInitPaletteFromStore). This is causing issues in useEffect behavior. The reload after auth is failing because of this only.
  • The new zustand hook useApplicationState can be separated into smaller hooks later.
    -I will start writing test case for hooks to add a safety net for state behavior.

Note: Also We have not added useEffect dependency at lot of places. We should be avoiding this because It can lead to unexpected issues. React official docs also recommend to do same ( https://www.npmjs.com/package/eslint-plugin-react-hooks ).

@kamalkishor1991 kamalkishor1991 merged commit 4231ee8 into master Apr 25, 2024
2 checks passed
@kamalkishor1991 kamalkishor1991 deleted the palette-reload-after-auth branch April 25, 2024 17:24
kamalkishor1991 pushed a commit that referenced this pull request Jun 1, 2024
* unnessary code removed

* moved all application state to zustand + reload data on login fixed

* removed console
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.

None yet

2 participants