Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dengwb1991/owl-redux
A simple version of redux
https://github.com/dengwb1991/owl-redux
front-end owl redux
Last synced: 16 days ago
JSON representation
A simple version of redux
- Host: GitHub
- URL: https://github.com/dengwb1991/owl-redux
- Owner: dengwb1991
- License: mit
- Created: 2019-12-10T06:22:53.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-23T02:40:25.000Z (about 5 years ago)
- Last Synced: 2025-01-01T19:35:18.006Z (23 days ago)
- Topics: front-end, owl, redux
- Language: JavaScript
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# owl redux
A simple version of redux, `Typescript` support.
## Introduction
In order to further understand `redux`, imitate the principle of `redux` implementation and implement a simple `redux`.
## Install
```bash
$ yarn add -D owl-redux
```## Example
Try to use [example](https://github.com/dengwb1991/owl-redux/tree/master/examples)
```bash
$ git clone [email protected]:dengwb1991/owl-redux.git$ cd owl-redux
$ yarn
$ yarn start
```## API
| api | instructions |
| -- | -- |
| createStore | Created `Store` Object, Includes `getState`, `dispatch`, `subscribe`, `replaceReducer` functions |
| reducer | `Reducer` is a planning function that takes the old `state` and `action` and generates the new state |
| action | `Action` is an object and must contain a `type` field |
| dispatch | Dispatch (action) triggers an `action` to generate a new `state` |
| subscribe | Implement the subscription function. Each time the `dispatch` is triggered, the subscription function will be executed |
| combineReducers | Combine multiple reducers into one `reducer` |
| replaceReducer | Replace `reducer` function |
| middleware | Extending the `dispatch` function |## More
[Create redux from scratch](https://github.com/dengwb1991/lifelong-learning/tree/master/relearn-redux)