프로젝트
GitHub에서 보기
redux-utilities/redux-actions
redux-utilities/redux-actions has 6,444 GitHub stars and 290 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-12 11:57 UTC. Last push 2024-07-21.
Flux Standard Action utilities for Redux.
측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalredux-actions
Flux Standard Action utilities for Redux
Table of Contents
Getting Started
Installation
$ npm install --save redux-actions
or
$ yarn add redux-actions
The npm package provides ES modules that should be compatible with every modern build tooling.
Usage
import { createActions, handleActions, combineActions } from 'redux-actions';
const defaultState = { counter: 10 };
const { increment, decrement } = createActions({
INCREMENT: (amount = 1) => ({ amount }),
DECREMENT: (amount = 1) => ({ amount: -amount })
});
const reducer = handleActions(
{
[combineActions(increment, decrement)]: (
state,
{ payload: { amount } }
) => {
return { ...state, counter: state.counter + amount };
}
},
defaultState
);
export default reducer;
See the full API documentation.