All Projects → itsmepetrov → redux-entities

itsmepetrov / redux-entities

Licence: MIT license
Higher-order reducer for store entities received from normalizr and makes it easy to handle them.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to redux-entities

redux-reducer-async
Create redux reducers for async behaviors of multiple actions.
Stars: ✭ 14 (-58.82%)
Mutual labels:  reducer, reducers
riduce
Get rid of your reducer boilerplate! Zero hassle state management that's typed, flexible and scalable.
Stars: ✭ 14 (-58.82%)
Mutual labels:  reducer, reducers
k-redux-factory
Factory of Redux reducers and their associated actions and selectors.
Stars: ✭ 18 (-47.06%)
Mutual labels:  reducer, reducers
Redux Ecosystem Links
A categorized list of Redux-related addons, libraries, and utilities
Stars: ✭ 5,076 (+14829.41%)
Mutual labels:  reducer
Async Reduce
Reducer for similar simultaneously coroutines
Stars: ✭ 17 (-50%)
Mutual labels:  reducer
React Hook Thunk Reducer
📡 A React useReducer() hook whose dispatcher supports thunks à la redux-thunk.
Stars: ✭ 91 (+167.65%)
Mutual labels:  reducer
mongodb-tree-structure
Implementing Tree Structure in MongoDB
Stars: ✭ 14 (-58.82%)
Mutual labels:  normalizr
Reductor
Redux for Android. Predictable state container library for Java/Android
Stars: ✭ 460 (+1252.94%)
Mutual labels:  reducer
Redhooks
Predictable state container for React apps written using Hooks
Stars: ✭ 149 (+338.24%)
Mutual labels:  reducer
Lithium
Line-based testcase reducer
Stars: ✭ 80 (+135.29%)
Mutual labels:  reducer
Use Reducer With Side Effects
Stars: ✭ 75 (+120.59%)
Mutual labels:  reducer
Puddles
Tiny vdom app framework. Pure Redux. No boilerplate.
Stars: ✭ 24 (-29.41%)
Mutual labels:  reducer
Use Substate
🍙 Lightweight (<600B minified + gzipped) React Hook to subscribe to a subset of your single app state.
Stars: ✭ 97 (+185.29%)
Mutual labels:  reducer
Useeffectreducer
useReducer + useEffect = useEffectReducer
Stars: ✭ 642 (+1788.24%)
Mutual labels:  reducer
Deox
Functional Type-safe Flux Standard Utilities
Stars: ✭ 200 (+488.24%)
Mutual labels:  reducer
Repatch
Dispatch reducers
Stars: ✭ 516 (+1417.65%)
Mutual labels:  reducer
Clean State
🐻 A pure and compact state manager, using React-hooks native implementation, automatically connect the module organization architecture. 🍋
Stars: ✭ 107 (+214.71%)
Mutual labels:  reducer
Use Reducer X
🔩 An alternative to useReducer that accepts middlewares.
Stars: ✭ 62 (+82.35%)
Mutual labels:  reducer
Reapex
A lightweight framework to build pluggable and extendable redux/react application
Stars: ✭ 58 (+70.59%)
Mutual labels:  reducer
Xstateful
A wrapper for xstate that stores state, handles transitions, emits events for state changes and actions/activities, and includes an optional reducer framework for updating state and invoking side-effects
Stars: ✭ 81 (+138.24%)
Mutual labels:  reducer

Redux Entities

build status npm version

Higher-order reducer for store entities received from normalizr and makes it easy to handle them.

Installation

npm install --save redux-entities

Usage

Use with entitiesReducer

import { combineReducers } from 'redux';
import { entitiesReducer } from 'redux-entities';
import { merge, omit } from 'lodash';

function contacts(state = {}, action) {
  const { type, payload } = action;

  switch (type) {

  case UPDATE_CONTACT:
  case REMOVE_CONTACT:
    return merge({}, state, { [payload.id]: {
      ...state[payload.id],
      isPending: true
    }});

  case UPDATE_CONTACT_SUCCESS:
    return merge({}, state, { [payload.id]: {
      ...state[payload.id],
      isPending: false
    }});

  case REMOVE_CONTACT_SUCCESS:
    return omit(state, meta.id);

  default:
    return state;
  }
}

export default combineReducers({
  contacts: entitiesReducer(contacts, 'contacts')
});

Use with combineEntitiesReducers

import { combineEntitiesReducers } from 'redux-entities';
import { contacts, groups, images, notes } from './entities';

export default combineEntitiesReducers({
  contacts,
  groups,
  images,
  notes
});

Immutable

If you want to use Immutable with Redux please check out this version of the library: redux-entities-immutable

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].