Use Redux for global state management
Taking inspiration from our work on the mobile wallet, let's switch to using Redux to increase state mgmt transparency and predictability.
As a side note, I just stumbled upon Zustand (used by Argent X, so used as well in our extension). It's looks quite promising, more and more popular, and I'd really like to get @nop33 opinion on it when he comes back :) I'm not saying that we're gonna use it in the desktop wallet instead of redux, but it's worth taking a look before we start the task!
https://www.npmjs.com/package/zustand https://github.com/pmndrs/zustand
Hey, thanks for sharing this! I just read through the GH readme and it looks like a really neat tool for state management! The Redux Toolkit also provides some of the benefits that Zustand does in comparison to plain Redux. But for a better evaluation, we'd need to try out an in-depth comparison of the 2 tools (how do we do "this" in Redux Toolkit and how in Zustand), see if we have any improvements in performance, dev speed, etc.
EDIT: Maybe it'd be worth to use Zustand in the desktop wallet and Toolkit in the mobile wallet, in parallel, and see what we like the most.
Maybe it'd be worth to use Zustand in the desktop wallet and Toolkit in the mobile wallet, in parallel, and see what we like the most.
Yes, that's the idea I had in mind!
I really like how simply Zustand is handling async actions. It is true that it is quite a complicated process in Toolkit (but it's something I quickly got used to so it doesn't cause a big problem).
We are using Redux for everything necessary now! @mvaivre, shall we close this?
I'll close this due to inactivity and since everything necessary is moved to Redux