Gcaufy 4f07b2cfa5 feat: added ci release support před 4 roky
..
dist 1a3b4e5c02 build: build dist před 4 roky
CHANGELOG.md 4f07b2cfa5 feat: added ci release support před 4 roky
README.md 741e221f50 feat(redux): added redux support před 5 roky
helper.js 0ff522c870 style: eslint style fixs part II před 5 roky
index.js 02aa812725 style: eslint auto fix před 5 roky
install.js 0ff522c870 style: eslint style fixs part II před 5 roky
package.json 4f07b2cfa5 feat: added ci release support před 4 roky

README.md

Redux in WePY 2.0

Install

npm install @wepy/redux redux --save

Usage

  1. Install Redux ``` // app.wpy import wepy from '@wepy/core'; import wepyRedux from '@wepy/redux';

wepy.use(wepyRedux);


2. Initialize a store

// ~/store.js import { createStore, combineReducers } from 'redux';

export default createStore(combineReducers({ counter (state = { num: 0 }, action) {

switch (action.type) {
  case 'ADD':
    return {
      ...state,
      num: state.num + 1
    };
}
return state;

} }));


3. Map to Component

// ~/counter.wpy

{{counter.num}}
Increment