All Projects → arnelenero → Simpler State

arnelenero / Simpler State

Licence: mit
The simplest app state management for React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Simpler State

react-cool-form
😎 📋 React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+261.76%)
Mutual labels:  hooks, state
Pullstate
Simple state stores using immer and React hooks - re-use parts of your state by pulling it anywhere you like!
Stars: ✭ 683 (+904.41%)
Mutual labels:  hooks, state
jedisdb
redis like key-value state management solution for React
Stars: ✭ 13 (-80.88%)
Mutual labels:  hooks, state
eventrix
Open-source, Predictable, Scaling JavaScript library for state managing and centralizing application global state. State manage system for react apps.
Stars: ✭ 35 (-48.53%)
Mutual labels:  hooks, state
Fielder
A field-first form library for React and React Native
Stars: ✭ 160 (+135.29%)
Mutual labels:  hooks, state
useSharedState
useSharedState is a simple hook that can be used to share state between multiple React components.
Stars: ✭ 0 (-100%)
Mutual labels:  hooks, state
atomic-state
A decentralized state management library for React
Stars: ✭ 54 (-20.59%)
Mutual labels:  hooks, state
Flooks
🍸 A state manager for React Hooks
Stars: ✭ 201 (+195.59%)
Mutual labels:  hooks, state
Iostore
极简的全局数据管理方案,基于 React Hooks API
Stars: ✭ 99 (+45.59%)
Mutual labels:  hooks, state
Use Global Context
A new way to use “useContext” better
Stars: ✭ 34 (-50%)
Mutual labels:  hooks, state
Tng Hooks
Provides React-inspired 'hooks' like useState(..) for stand-alone functions
Stars: ✭ 954 (+1302.94%)
Mutual labels:  hooks, state
Clean State
🐻 A pure and compact state manager, using React-hooks native implementation, automatically connect the module organization architecture. 🍋
Stars: ✭ 107 (+57.35%)
Mutual labels:  hooks, state
Outstated
Simple hooks-based state management for React
Stars: ✭ 102 (+50%)
Mutual labels:  hooks, state
Pure Store
A tiny immutable store with type safety.
Stars: ✭ 133 (+95.59%)
Mutual labels:  hooks, state
React Model
The next generation state management library for React
Stars: ✭ 153 (+125%)
Mutual labels:  hooks
Git Hooks Js
A tool to manage and run project git hooks
Stars: ✭ 158 (+132.35%)
Mutual labels:  hooks
Go Sdk
Dapr SDK for go
Stars: ✭ 149 (+119.12%)
Mutual labels:  state
React Copy Write
✍️ Immutable state with a mutable API
Stars: ✭ 1,810 (+2561.76%)
Mutual labels:  state
Spotify Clone Client
A ReactJS clone application of the popular Spotify music streaming service. This application utilizes the Spotify API and the Spotify Web Playback SDK
Stars: ✭ 162 (+138.24%)
Mutual labels:  hooks
Redux Rs
📦 A Rust implementation of Redux.
Stars: ✭ 158 (+132.35%)
Mutual labels:  state

SimpleR State

npm build coverage license

SimpleR State is an ultra-lightweight library that provides the simplest state management for React.

  • Minimalist API; no complicated concepts or boilerplate
  • Use plain functions to update state (including async)
  • Largely unopinionated with flexible syntax
  • Extremely simple to unit test state logic
  • Highly extensible with plug-ins (e.g. persistence, dev tools)
  • Full TypeScript support with uncomplicated types
  • Made specifically for React, and built on React Hooks
  • Multiple times faster than context/reducer solution
  • It's tiny, just around 1 KB (minified + gzipped)

Get all these benefits with one dependency install:

npm install simpler-state

Two Easy Steps!

Step 1: Create an entity (shared state) and actions (updater functions)

// counter.js

import { entity } from 'simpler-state'

export const counter = entity(0)

export const reset = () => {
  counter.set(0)
}

export const increment = by => {
  counter.set(value => value + by)  
}

Step 2: Use the entity in your components with hooks

import { counter, increment, reset } from 'counter'

const CounterView = () => {
  const count = counter.use()

  return (
    <>
      <div>{count}</div>

      <button onClick={() => increment(1)}> + </button> 
      <button onClick={reset}> Reset </button>
    </>
  )
}

It's that simple! But the library can do a lot more.

Documentation

Learn more about what you can do with SimpleR State at simpler-state.js.org.

Feedback

I have opened a Request For Comments (here) on GitHub. Your comments and suggestions would be greatly appreciated.

And if you like this library, the concept, and its simplicity, please give it a star on the GitHub repo to let me know. 😀

Prior Art

This library is an evolution of the already production-proven react-entities that I also wrote. It shares the same stable core, but with a very different API.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].