vue-duo

    1.2.0 • Public • Published

    NPM version Build status Test coverage License Dependency status

    vue-duo

    • You can handle complex data flow with awesome rxjs.
    • vue-duo provide a tiny store for simple data flow, works fine with vue-rx.

    Getting Started

    • app.vue
     
    <template>
      <div>
        <h3>{{ count }}</h3>
        <button @click="add(1)">add</button>
      </div>
    </template>
     
    <script>
     
    import { add } from './action'
    import store from './store'
     
    export default {
      name: 'app',
      store,
      methods: {
        add
      }
    }
     
    </script>
     
    • action.js
     
    import { createAction } from 'vue-duo'
     
    export const add = createAction((num) => num)
     
    • store.js
     
    import { createStore } from 'vue-duo'
     
    import { add } from './action'
     
    const store = createStore({
      count: 0
    })
     
    store.subscribeActions({
      [add]: (num) => ({
        count: store.state.count + num
      })
    })
     
    export default store
     

    Usage

    License

    MIT

    Keywords

    Install

    npm i vue-duo

    DownloadsWeekly Downloads

    2

    Version

    1.2.0

    License

    MIT

    Last publish

    Collaborators

    • coderhaoxin
    • haoxins