reduce-reducers

WebJar for reduce-reducers

License

License

MIT
Categories

Categories

Github Development Tools Version Controls
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

github-com-acdlite-reduce-reducers
Last Version

Last Version

0.1.1
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/acdlite/reduce-reducers

Download github-com-acdlite-reduce-reducers

How to add to project

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

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

Versions

Version
0.1.1