reduce-reducers

WebJar for reduce-reducers

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

reduce-reducers
Last Version

Last Version

0.4.3
Release Date

Release Date

Type

Type

jar
Description

Description

reduce-reducers
WebJar for reduce-reducers
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/redux-utilities/reduce-reducers

Download reduce-reducers

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/reduce-reducers/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>reduce-reducers</artifactId>
    <version>0.4.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/reduce-reducers/
implementation 'org.webjars.npm:reduce-reducers:0.4.3'
// https://jarcasting.com/artifacts/org.webjars.npm/reduce-reducers/
implementation ("org.webjars.npm:reduce-reducers:0.4.3")
'org.webjars.npm:reduce-reducers:jar:0.4.3'
<dependency org="org.webjars.npm" name="reduce-reducers" rev="0.4.3">
  <artifact name="reduce-reducers" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='reduce-reducers', version='0.4.3')
)
libraryDependencies += "org.webjars.npm" % "reduce-reducers" % "0.4.3"
[org.webjars.npm/reduce-reducers "0.4.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

Looking for Maintainers

Unfortunately I (timche) don't have the required time anymore to maintain this library and give it the necessary attention. Therefore I'm looking for maintainers that are willing to take care of this library on a long-term basis.

Requirements:

  • Having knowledge of this library and open-source in general.
  • Keeping the philosophy and goals of this library.
  • Taking care of issues and pull requests.
  • If required and reasonable, working out next versions of this library with the intention to improve it with the community in mind and not for the sole purpose.
  • Knowing what's good for the library and what not (e.g. not accepting every suggestion) in order to maintain the library scope.
  • Having knowledge about the tooling (CI, build system, etc.) and the docs and maintaining them.

It's also possible to join redux-utilities, an umbrella organization of complementing redux utility libraries like this one, to take care of few or all libraries. Please let me know if you are interested in that.

Please send me an email (adress on my profile) with the subject "reduce-reducers" and some information about you, if you want to be a maintainer.

reduce-reducers

Build Status npm Version npm Downloads Monthly

Reduce multiple reducers into a single reducer from left to right

Install

npm install reduce-reducers

Usage

import reduceReducers from 'reduce-reducers';

const initialState = { A: 0, B: 0 };

const addReducer = (state, payload) => ({ ...state, A: state.A + payload });
const multReducer = (state, payload) => ({ ...state, B: state.B * payload });

const reducer = reduceReducers(initialState, addReducer, multReducer);

const state = { A: 1, B: 2 };
const payload = 3;

reducer(state, payload); // { A: 4, B: 6 }

FAQ

Why?

Originally created to combine multiple Redux reducers that correspond to different actions (e.g. like this). Technically works with any reducer, not just with Redux, though I don't know of any other use cases.

What is the difference between reduceReducers and combineReducers?

This StackOverflow post explains it very well: https://stackoverflow.com/a/44371190/5741172

org.webjars.npm

Redux Utilities

Useful utilities to build Redux applications

Versions

Version
0.4.3