Skip to content
Projetos

bluebill1049/little-state-machine

Ver no GitHub

Sobre

Hook personalizado do React para gerenciamento persistente de estado.

Desenvolvimento web e de aplicativos

Como estes números são medidos

O que você pode fazer

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

Crescimento medido de estrelas

em 24 h
0
em 7 dias
0
em 15 dias
0
em 1 mês
0

Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.

README.md

Original

Simple global state for React.

npm downloads npm License

Get started | Documentation | Quickstart

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.

Explore projetos relacionados

Carregando…