0.0.1 • Published 4 years ago

owl-redux v0.0.1

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

owl redux

A simple version of redux

Introduction

In order to further understand redux, imitate the principle of redux implementation and implement a simple redux.

Install

$ yarn add -D owl-redux

Example

Try to use example

$ git clone git@github.com:dengwb1991/owl-redux.git

$ cd owl-redux

$ yarn

$ yarn start

API

apiinstructions
createStoreCreated Store Object, Includes getState, dispatch, subscribe, replaceReducer functions
reducerReducer is a planning function that takes the old state and action and generates the new state
actionAction is an object and must contain a type field
dispatchDispatch (action) triggers an action to generate a new state
subscribeImplement the subscription function. Each time the dispatch is triggered, the subscription function will be executed
combineReducersCombine multiple reducers into one reducer
replaceReducerReplace reducer function
middlewareExtending the dispatch function