desktop-wallet icon indicating copy to clipboard operation
desktop-wallet copied to clipboard

Use Redux for global state management

Open mvaivre opened this issue 3 years ago • 4 comments

Taking inspiration from our work on the mobile wallet, let's switch to using Redux to increase state mgmt transparency and predictability.

mvaivre avatar Aug 30 '22 07:08 mvaivre

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

mvaivre avatar Aug 31 '22 14:08 mvaivre

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.

nop33 avatar Sep 21 '22 09:09 nop33

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!

mvaivre avatar Sep 21 '22 09:09 mvaivre

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).

nop33 avatar Sep 21 '22 09:09 nop33

We are using Redux for everything necessary now! @mvaivre, shall we close this?

nop33 avatar Feb 27 '23 15:02 nop33

I'll close this due to inactivity and since everything necessary is moved to Redux

nop33 avatar Mar 08 '23 14:03 nop33