3.0.0-alpha.4 • Published 1 year ago

@redux-eggs/redux v3.0.0-alpha.4

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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()])
3.0.0-alpha.3

1 year ago

3.0.0-alpha.4

1 year ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago