Simple Shared State

Redux is verbose. SimpleSharedState is brief.


SimpleSharedState is still relatively experimental. Versions are following semver, but the version being greater than 1.0 doesn't mean it's considered production ready just yet. Please review the project source and tests to determine if it's viable for your project. More elaborate tests are needed to test SimpleSharedState performance against Redux.

Get It

npm install simple-shared-state

If using script tags:

<script src=""></script>
  const store = new SimpleSharedState.Store({});

Support for Internet Explorer

Use dist/simple-shared-state.es5.umd.js. For example:

<script src=""></script>

Basic Use

First create a store.

import { Store } from "simple-shared-state";

const initialState = {
  user: {
    name: "Alice",
    slogan: "simple-shared-state makes apps fun again",
const actions = () => ({
  changeSlogan: (newSlogan) => ({
    user: {
      slogan: newSlogan,
const store = new Store(initialState, actions);

Then create a watcher. Don't worry about error handling in selectors, just return the state that you want.

const selector = (state) => state.user;, (state) => {
  console.log("user snapshot:", state);

Then call your action to update state and trigger the watch handler.

store.actions.changeSlogan("simple-shared-state is better than cat memes");
// 'user snapshot:' { name: 'Alice', slogan: 'simple-shared-state is better than cat memes' }

Redux Devtools

Works with devtools, of course. Just pass in the reference like this:

const store = new Store(initialState, actions, window.__REDUX_DEVTOOLS_EXTENSION__);

React Hooks


Future Work

  • Fix redux devtools integration
  • Add support for async/await in action creators
  • Support typescript types
  • Explore potential to optimize selector processing for very large state trees