Utilities > State Management


vue-duo 0.06


vue + rxjs
  • rxjs
  • vue
  • vuejs
  • duo
  • rx
last commit 7 years ago
16
Stargazers

Watchers
16
Open issues
6
467
Downloads

Last 30 days
32
Releases
5
61
Final Score

Quality
81
Popularity
6
Maintenance
100

NPM version Build status Test coverage License Dependency status

Deprecated, try movue

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