ReactStateMuseum - A whirlwind tour of React state management systems by example

  •        59

Every app is meant to be small, simple, and the same as each other. The only difference should be the state management decisions of each. The repeated React and ReactNative app is a Packing List, with the name based on the state technology.

https://github.com/GantMan/ReactStateMuseum#readme

Tags
Implementation
License
Platform

   




Related Projects

statty - A tiny and unobtrusive state management library for React and Preact apps

  •    Javascript

Most of the time, I see colleagues starting React projects setting up Redux + a bunch of middlewares and store enhancers by default, regardless of the project nature.Despite Redux being awesome, it's not always needed and it may slow down the process of onboarding new developers, especially if they are new to the React ecosystem (I have often seen colleagues being stuck for hours trying to understand what was the proper way to submit a simple form).

mobx-store - A data store with declarative querying, observable state, and easy undo/redo.

  •    Javascript

A data store with declarative querying, observable state, and easy undo/redo. One of the best things about the store is that you can use it with mobx-react because it's based upon MobX. This also means that when you mutate your objects you don't need setState() calls because MobX will handle all the updating for you.

MobX - Simple, scalable state management.

  •    Javascript

MobX is a battle tested, simple and scalable state management library transparently applying functional reactive programming (TFRP). The Mobx design principle is very simple: Anything that can be derived from the application state, should be derived. Automatically. This includes the UI, data serialization, server communication, etc.

parket - A library to manage application state, heavily inspired by mobx-state-tree

  •    TypeScript

I was disappointed with all the current state management solutions. Then I found mobx-state-tree, which seemed like a godsend to me (ok not really, but I liked the concept), but it was pretty big in terms of file size (mobx alone is big: 16.5kB). So I thought it's surely possible to make a smaller version of it, that's how this started. And after 2 failed attempts I can finally say: Here it is in all of its "glory". Note: This library uses Proxies and Symbols. Proxies cannot be fully polyfilled so you have to target modern browers which support Proxies.

react-values - A set of tiny React components for handling state with render props.

  •    Javascript

A set of tiny, composable React components for handling state with render props. It does this using a small render-prop-based API that exposes helpful transforms like toggle, increment, filter, etc. depending on the type of value, all based on JavaScripts native value types...


akita - πŸš€ State Management Tailored-Made for JS Applications

  •    TypeScript

Whether it be Angular, React, Vue, Web Components or plain old vanilla JS, Akita can do the heavy lifting and serve as a useful tool for maintaining clean, boilerplate-free, and scalable applications. Akita is a state management pattern, built on top of RxJS, which takes the idea of multiple data stores from Flux and the immutable updates from Redux, along with the concept of streaming data, to create the Observable Data Stores model.

freactal - Clean and robust state management for React and React-like libs.

  •    Javascript

freactal is a composable state management library for React.The library grew from the idea that state should be just as flexible as your React code; the state containers you build with freactal are just components, and you can compose them however you'd like. In this way, it attempts to address the often exponential relationship between application size and complexity in growing projects.

react-native-seed - Get your favorite boilerplate of React Native

  •    

This repo is used to collect stars for ReactNativeSeed.com. ReactNativeSeed.com provides you with a number of React Native Boilerplates to choose from. You can opt for MobX or Redux for state-management, TypeScript or Flow for static type checking and CRNA or plain React Native for the stack.

redux-react-local - local component state via redux

  •    Javascript

Add the supplied reducer to a key local on your redux store. However, because 'views' don't have global references / identities ala Backbone etc, communicating between these components can get cumbersome 2; we then resort to building some form of messaging system external to these components - callbacks, pubsub channels, flux stores, observable event chains, etc. The smart ones use context to expose these systems to a particular render tree, avoiding 'global' state, but still getting a similar model.

redux-form - A Higher Order Component using react-redux to keep form state in a Redux store

  •    Javascript

redux-form works with React Redux to enable an html form in React to use Redux to store all of its state. You can play around with redux-form in these sandbox versions of the Examples.

redux-router - Redux bindings for React Router – keep your router state inside your Redux store

  •    Javascript

Redux bindings for React Router. React Router is a fantastic routing library, but one downside is that it abstracts away a very crucial piece of application state — the current route! This abstraction is super useful for route matching and rendering, but the API for interacting with the router to 1) trigger transitions and 2) react to state changes within the component lifecycle leaves something to be desired.

redux-react-hook - React Hook for accessing state and dispatch from a Redux store

  •    TypeScript

React hook for accessing mapped state and dispatch from a Redux store. NOTE: React hooks require react and react-dom version 16.8.0 or higher.

redux-beacon - Analytics integration for Redux and ngrx/store

  •    TypeScript

If you're using Redux or ngrx/store to manage your app's state, you can use Redux Beacon to tap into your dispatched actions and map them to events that are consumable by an analytics service (e.g. Google Analytics). With Redux Beacon your entire global state life-cycle becomes trackable. Redux Beacon is lightweight. The core Redux Beacon module is tiny (~ 1KB), and each target, extension, and util, is either around the same size or smaller.

constate - Scalable state manager using React context

  •    TypeScript

React state management library built with scalability in mind. You can start simple with local state and scale up to global state with ease when needed. In computer science, a container is a class, a data structure, or an abstract data type (ADT) whose instances are collections of other objects. In other words, they store objects in an organized way that follows specific access rules.

redux-connect - Provides decorator for resolving async props in react-router, extremely useful for handling server-side rendering in React

  •    Javascript

How do you usually request data and store it to redux state? You create actions that do async jobs to load data, create reducer to save this data to redux state, then connect data to your component or container. Usually it's very similar routine tasks.

react-contextual - πŸš€ react-contextual is a small (less than 1KB) helper around React 16s new context api

  •    Javascript

Click this link for a detailed explanation. Pass a store (which stores some state and actions to update the state) to Provider. Then receive the props in the store either by using a HOC or render-props.

use-immer - Use immer to drive state with a React hooks

  •    TypeScript

A hook to use immer as a React hook to manipulate state. useImmer(initialState) is very similar to useState. The function returns a tuple, the first value of the tuple is the current state, the second is the updater function, which accepts an immer producer function, in which the draft can be mutated freely, until the producer ends and the changes will be made immutable and become the next state.

moreartyjs - Morearty.js - centralized state management for React in pure JavaScript

  •    Javascript

Morearty.js is a thin layer on top of React (implemented as a mixin) providing better state management facilities in the manner of Om but written in pure JavaScript. Underneath, Morearty leverages immutable data structures, provided by Facebook's Immutable library, which hold the state of an application. That state is described by a single Binding object and all state transitions are performed through it. When an application component needs to delegate a part of its state to a sub-component, it can create a sub-binding which points to a nested location within the global state and is fully synchronized with the original binding. This way every component knows only what it should know and the entire state is effectively encapsulated. Morearty detects any changes automatically and triggers re-rendering. Moreover, each component gets a correctly defined shouldComponentUpdate method that compares the component's state using straightforward JavaScript strict equals operator ===. So, only the components whose state was altered are re-rendered.

eslint-plugin-immutable - ESLint plugin to disable all mutation in JavaScript.

  •    Javascript

This is an ESLint plugin to disable all mutation in JavaScript. Think this is a bit too restrictive? Well if you're using Redux and React, there isn't much reason for your code to be mutating anything. Redux maintains a mutable pointer to your immutable application state, and React manages your DOM state. Your components should be stateless functions, translating data into Virtual DOM objects whenever Redux emits a new state. These ESLint rules explicitly prohibit mutation, effectively forcing you to write code very similar to Elm in React. There's no reason to use let in a Redux/React application, because all your state is managed by either Redux or React. Use const instead, and avoid state bugs altogether.

connected-react-router - A Redux binding for React Router v4

  •    Javascript

✨ Synchronize router state with redux store with uni-directional flow (history -> store -> router -> components). 🎁 Support React Router v4.