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

Consider State Management solution to refactor useInkathon into smaller hooks #6

Open
wottpal opened this issue Jan 13, 2023 · 6 comments

Comments

@wottpal
Copy link
Member

wottpal commented Jan 13, 2023

No description provided.

@nicolad
Copy link

nicolad commented Feb 21, 2023

is this still relevant, since u already use context API from react?

@wottpal
Copy link
Member Author

wottpal commented Feb 21, 2023

Yep, as i can't easily access this provider context outside hooks.. and it's already huge right now and i see no straightforward way splitting it up w/o using some other state management solution.

@nicolad
Copy link

nicolad commented Feb 21, 2023

Have you used smth like recoil?

https://recoiljs.org/

I am using react-query and react-hook-form in prod, so I don't really need dedicated state management.

@jalooc
Copy link

jalooc commented Mar 14, 2023

Hey, sleek lib @wottpal, well done 👍 Looking forward to trying it out.

In terms of React state management solutions in which you want an ability to access state outside of hooks, or even React components, I can recommend https://github.com/pmndrs/zustand - really simple to use and similar to Redux in principles, but without its boilerplate.

@wottpal
Copy link
Member Author

wottpal commented Mar 15, 2023

Thanks so much @jalooc. Would really love to hear more about your experience with the lib or in general what you are up to in the ink! space :) (We also have a tg group https://t.me/inkathon).

And I know Zustand and it's awesome! Recently I've also started using https://jotai.org/ which is dope as well, even though it follows a different paradigm than Zustand/Redux.

@niklasp
Copy link
Contributor

niklasp commented Mar 18, 2024

i wouldn't introduce a state management library and leave that to the users. let's rely solely on react context for state management. in my former apps i was separating my providers into two internally:

  1. extension provider (browser extension related stuff: accounts, activeAccount, signer, ...)
  2. chain provider (polkadot api related stuff: api, activeChain, switchActiveChain)

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

No branches or pull requests

4 participants