@intactile/redux-utils

0.1.0 • Public • Published

redux-utils

An undo redo package for redux

Build Status Maintainability Test Coverage

Installation

npm install @intactile/redux-utils

or

yarn add @intactile/redux-utils

Usage

createModuleReducer

Create a reducer which delegates to case reducers:

import { createModuleReducer } from "@intactile/redux-utils";

const caseReducers = {
  ADD: (state, action) => state + action.payload,
  MULTIPLY: (state, action) => state * action.payload,
  DIVIDE: (state, action) => state / action.payload
};

const initialState = 10;
const reducer = createModuleReducer(caseReducers, initialState);

createActionCreator

import { createActionCreator } from "@intactile/redux-utils";

const add = createActionCreator('ADD');
add(10): // => { type: ADD, payload: 10 }

Readme

Keywords

Package Sidebar

Install

npm i @intactile/redux-utils

Weekly Downloads

7

Version

0.1.0

License

Apache-2.0

Unpacked Size

169 kB

Total Files

9

Last publish

Collaborators

  • intactile