-
-
Notifications
You must be signed in to change notification settings - Fork 35
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: move the algod client to store #224
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.
Appreciate you splitting this from your other PR so the changes can be addressed separately. Overall this looks good, and most of my change requests are minor optimizations. The important one is making sure loadPersistedState
has the correct return type.
While this does handle moving the algod client to the store in the core library, I'm curious whether this now works as expected in your Vue app (AlgoTools)? When @SilentRhetoric made his PR to fix network switching in the Solid adapter, the critical change was moving the algod client to the @tanstack/solid-store
reactive store.
The way he described it to me, I would have expected something similar to get it working properly in the Vue adapter: accessing the algodClient
like this:
const algodClient = useStore(manager.store, (state) => state.algodClient)
and having that be what's returned from its useWallet
composable function.
That's what I was planning to do in the Vue and React adapters when I created #213. Your changes here were also needed! I was just expecting the framework-specific reactive stores to also be part of the solution.
Vue reactivity is handled in EDIT: The React |
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.
Looks great! LGTM
This is to address issue #213
algodClient
prop on theWalletManager
with a getter and setter that point to thestore
algodClient
from persisted storage - the re-serialization makes it useless anywaysetActiveNetwork
onstore
now takesalgodClient
as a parameter