@redux-eggs/redux
TypeScript icon, indicating that this package has built-in type declarations

3.0.0-alpha.4 • Public • Published

Redux Eggs for Redux

Redux Eggs wrapper for Redux.

Contents:

Installation:

If you are using Yarn, run

yarn add @redux-eggs/core @redux-eggs/redux

If you are using NPM, run

npm install --save @redux-eggs/core @redux-eggs/redux

⚠️ Minimum supported versions of peer dependencies:

  • redux 4.0.0 and newer

Usage

Create your store:

import { createStore } from '@redux-eggs/redux'

export const store = createStore()

Add reducer to egg:

// my-egg.js
import { myReducer } from '../my-reducer'

export const getMyEgg = () => {
  return {
    id: 'my-egg',
    reducersMap: {
      myState: myReducer,
      // ...
    },
    // ...
  }
}

// my-another-egg.js
import { myAnotherReducer } from '../my-another-reducer'

export const getMyAnotherEgg = () => {
  return {
    id: 'my-another-egg',
    reducersMap: {
      myAnotherState: myAnotherReducer,
      // ...
    },
    // ...
  }
}

Add egg to your store:

import { getMyEgg } from '../eggs/my-egg'

// Somewhere in your application
store.addEggs([getMyEgg()])

// Somewhere else
import { getMyAnotherEgg } from '../eggs/my-another-egg'

// Somewhere in your application
store.addEggs([getMyAnotherEgg()])

Dependencies (0)

    Dev Dependencies (18)

    Package Sidebar

    Install

    npm i @redux-eggs/redux

    Weekly Downloads

    31

    Version

    3.0.0-alpha.4

    License

    MIT

    Unpacked Size

    8.03 kB

    Total Files

    6

    Last publish

    Collaborators

    • fostyfost