DEV Community

Muhammad Hasnain
Muhammad Hasnain

Posted on

 

What is your go-to state management library? No frameworks!

Hello.

What is your go-to state management library? I know we can use redux without React and I have. Redux is such an amazing tool. But, are there any alternatives? PS, if possible, also share how the library you mentioned saved your bum.

I remember I was working on a project where I was not going to use any JavaScript frameworks. Somewhat complex google maps system for a WordPress multisite. For each site we used to input the associated shop/branch coordinates and then polygon information for coverage area.

Since, there were over 25 sites, I cached all the settings in a new table that I had created in order to fetch all the data in a single query instead of changing the "blog", fetching that information for that specific site and changing it again.

The data was complex but I handled it beautifully. After I was done, I thought only if I had used Redux in order to make state management super super easy! My project did use custom observers, immutable data and selectors. Replacing that with Redux would've meant that other developers would've started with it like real easy!

Anyways, thanks for reading this post. Give me some awesome recommendation and also, how the library you mentioned saved you bum! Thanks!

Top comments (0)

typescript

11 Tips That Make You a Better Typescript Programmer

1 Think in {Set}

Type is an everyday concept to programmers, but it’s surprisingly difficult to define it succinctly. I find it helpful to use Set as a conceptual model instead.

#2 Understand declared type and narrowed type

One extremely powerful typescript feature is automatic type narrowing based on control flow. This means a variable has two types associated with it at any specific point of code location: a declaration type and a narrowed type.

#3 Use discriminated union instead of optional fields

...

Read the whole post now!