Global State

#react #global #state

Redux

single immutable atom for the whole UI

hard to code split

hard to optimize

Selector: useSelector

Recoiljs

multiple immutable atoms for the UI

it works with sync and async data

it has support to derived data

optimized to avoid re-rendering parts that don’t consume an atom

getters vs setters

Selector: useRecoilValue

Context

React context can only has one single value, so you need to use subscribe pattern to avoid re-rendering all components that consume them

Selector: useContext

Relay

Single store

Selector: GraphQL fragments

Mobx

Observables

Semi Global

Formik:

form field state should be able to be validated together

one form field change should not re-render all other fields, so it has good perf

## Links

Linked from
  • State MachineA state machine describes all possibly states for a given business logic or situation They are very useful to model business logic, like ecommerce order status, UI transitions,…
Shares tags with
  • Editor - React ConfContent Editable is an attribute that let any element to be editable Content Editable is usually use to build rich text editors, or markdown editors, or any kind of editors. The…
  • "Simple" PagesA call "simple" pages: landing pages, blog posts, simple websites. These "simple" pages have a high level complexity of CSS and animations, 2 skills that I'm not so good yet,…
  • A Failed TalkA talk is a good way to explain some concept. When doing a talk you need to know your audience, you can't target beginners and advanced users at once A failed talk can happen for…
  • Building from Scratch?why am I building my blog post from scratch? The idea is to learn all about the details to create great ux and dx I'd like to feel all the pain of writing everything in pure html…
  • Bundle analyzeMost modern apps can’t be built without dependencies, so we need to analyze the final bundle of our application to make sure we are not shipping unnecessary code We can also use…

Sign in with GitHub to reply.

Select any passage to quote it.

Comments