0.2.0 • Published 2 months ago

gitlike-redux v0.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

gitlike-redux

Use redux like git.

npm install --save gitlike-redux
# or
yarn add gitlike-redux

Instead of creating actions, reducers, and the rest of the boilerplate, just commit your store updates, like you would in git.

Your action type is your commit message (so it will show up in console). And your action body is an object that matches your store state, with edge properties wrapped using the val() helpers.

Basic example:

import { createStore } from 'redux';
import { reducer, commit, val } from 'gitlike-redux';

const store = createStore(reducer);

store.dispatch(
  commit('Initial state', val({
    initialized: false,
    config: {
      theme: 'light',
    }
  }))
);

store.dispatch(
  commit('Initialize and set dark mode', {
    initialized: val(true),
    config: {
      theme: val('dark'),
    }
  })
);

Library state: Used in production, but pretty rough.

Expect possible API changes.

Use at your own risk


What else is needed:

  • Array handling support
  • Batching commits (add() call?)
  • More tests
  • Documentation

License: MIT

0.2.0

2 months ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago