Back to Trending
RepositoryTypeScript
bluebill1049

bluebill1049/little-state-machine

📠 React custom hook for persist state management

1.5kstars
51forks
1issues
2views
Little State Machine

Little State Machine

Simple global state for React.

Features

  • Tiny, with no runtime dependencies
  • State persistence with session storage by default
  • Selectors to limit re-renders

Install

npm install little-state-machine

Quickstart

import { createStore, useStateMachine } from 'little-state-machine';

createStore({ count: 0 });

function increment(state) {
  return { ...state, count: state.count + 1 };
}

function Counter() {
  const { actions, state } = useStateMachine({ actions: { increment } });

  return <button onClick={() => actions.increment()}>{state.count}</button>;
}

Read the documentation for options, selectors, and TypeScript setup.

Similar Projects

Discover other similar projects and AI models.

RepositoryTypeScript
statelyai/xstate

State machines, statecharts, and actors for complex logic

30.6k
Nov 30, 2026
RepositoryTypeScript
pmndrs/zustand

🐻 Bear necessities for state management in React

59.0k
Nov 23, 2026
RepositoryTypeScript
effector/effector

Business logic with ease ☄️

4.9k
Nov 26, 2026
RepositoryTypeScript
diegohaz/constate

React Context + State

4.0k
Nov 28, 2026
RepositoryTypeScript
reatom/reatom

Reatom - the ultimate state manager

1.4k
Nov 29, 2026
RepositoryTypeScript
nanxiaobei/resso

🪢 The simplest React state manager

531
Oct 7, 2026
RepositoryTypeScript
StoneCypher/jssm

Fast, easy Javascript finite state machines with visualizations; enjoy a one liner FSM instead of pages. MIT; Typescripted; 100% test coverage. Implements the FSL language.

373
Nov 14, 2026
RepositoryTypeScript
freeCodeCamp/freeCodeCamp

freeCodeCamp.org's open-source codebase and curriculum. Learn math, programming, and computer science for free.

459.9k
Dec 2, 2026
RepositoryJavaScript
Tencent/westore

小程序MVVM分层架构

4.3k
May 1, 2026