vue-duo

vue and rxjs
352
Install
npm install vue-duo
Latest Version:1.2.0
Vue:2
License:MIT
Last Updated:Nov 27, 2017
Links: npm
Maintainer: coderhaoxin

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]: https://github.com/haoxins/vue-duo/blob/HEAD/(num) => ({
    count: store.state.count + num
  })
})

export default store

Usage

License

MIT

Related Packages

vue-rx

RxJS bindings for Vue

446,432 3,330
use-rx-vue

Description

353 0
@sigi/vue

Sigi framework binding for VueJS

2,722 210
vue-cli-plugin-rx

Vue-cli 3 plugin for adding RxJS support to project using vue-rx

1,735 20
@vueuse/rxjs

Enables RxJS reactive functions in Vue

927,704 22,398

Version History

Version Released Vue License
1.2.0 ^2.5.8 MIT
1.1.1 2 MIT
1.1.0 2 MIT
1.0.0 2 MIT
0.2.0 2 MIT