https://github.com/webpatch/redux-go
redux helpers
https://github.com/webpatch/redux-go
redux redux-helpers
Last synced: 3 months ago
JSON representation
redux helpers
- Host: GitHub
- URL: https://github.com/webpatch/redux-go
- Owner: webpatch
- Created: 2019-12-03T03:03:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-08T08:12:34.000Z (about 6 years ago)
- Last Synced: 2025-06-02T05:12:08.445Z (about 1 year ago)
- Topics: redux, redux-helpers
- Language: TypeScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Redux-go
Some redux helpers.
## Usage
```js
import { createAction, createReducer } from 'redux-go';
// define action
const changeData = createAction('changeData');
// define init state
const appState = { name: '' };
// define reducer
const reducer = createReducer({
[changeData]: (state, action) => {
return {...state, name: action.payload};
},
}, appState);
// dispatch action
dispatch(changeData('tom'))
```