vue redux binding higher order component

Vua Redux is tested to work on vue v2 and should be used with vue-jsx or in component template string. For more on vue-jsx https://github.com/vuejs/babel-plugin-transform-vue-jsx

Install

install through npm i vua-redux --save

Initialize

install in your root component

import Vue from ' vue ' ; import { reduxStorePlugin } from ' vua-redux ' ; import AppStore from ' ./AppStore ' ; import App from ' ./Component/App ' ; Vue . use ( reduxStorePlugin ) ; new Vue ( { store : AppStore , render ( h ) { return < App / > } } ) ;

import { createStore } from ' redux ' ; const initialState = { todos : [ ] } ; const reducer = ( state = initialState , action ) => { switch ( action . type ) { case ' ADD_TODO ' : return { ... state , todos : [ ... state . todos , action . data . todo ] } default : return state ; } } const AppStore = createStore ( reducer ) ; export default AppStore ;

Use in your component