Skip to content

An implementation of the redux modules pattern to modularize redux reducers, middleware and action creators

License

Notifications You must be signed in to change notification settings

github1/redux-modules

Repository files navigation

@github1/redux-modules

An implementation of the redux modules pattern to modularize redux reducers, middleware and action creators

This package provides utilities for encapsulating redux components such as reducer, middleware, actions, preloadedState in a strongly types structure which makes it simpler to build, organize and reuse logic.

build status npm version npm downloads

Install

npm install @github1/redux-modules --save

Usage

import { createModule } from '@github1/redux-modules';

const store = createModule('myModule')
  .reduce((state: MyState, action: MyActionTypes) => {
    if ('Increment' === action.type) {
      return { ...state, count: state.count + 1 };
    }
    return state;
  })
  .preloadedState({
    count: 0,
  })
  .asStore();

License

MIT

About

An implementation of the redux modules pattern to modularize redux reducers, middleware and action creators

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published