vudux

0.0.1 • Public • Published

Usage

store.js

import { createStore  } from 'redux'

function todos(state = [], action) {
  switch (action.type) {
    case 'ADD_TODO':
      return state.concat([ action.text ])
    default:
      return state
  }
}

export default createStore(todos, [ 'Use Redux' ])

vudux.js

import { createVudux } from 'vudux
import store from './store'

export default createVudux(store)

TodoList.vue

<template>
    <ul class="todos-list">
        <li class="todo" v-for="todo in todos">{{ todo }}</li>
    </ul>
</template>
<script>
    import vudux from './vudux'
    
    const props = state => {
        return {
            todos: state.todos
        }
    }
    
    export default {
        mixins: [ vudux(props) ]
    }
</script>

Readme

Keywords

Package Sidebar

Install

npm i vudux

Weekly Downloads

2

Version

0.0.1

License

ISC

Last publish

Collaborators

  • jeppe-smith