All Projects → vuejs → Vuex Observable

vuejs / Vuex Observable

Licence: mit
Consume Vuex actions as Observables using RxJS 5

Programming Languages

javascript
184084 projects - #8 most used programming language

THIS REPOSITORY IS DEPRECATED

vuex-observable

Proof of Concept, DO NOT USE YET

Consume Vuex actions as Observables using RxJS 5, inspired by redux-observable.

Usage

import Vue from 'vue'
import Vuex from 'vuex'
import { observableAction } from 'vuex-observable'
import 'rxjs/add/operator/delay'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    pinging: false
  },
  mutations: {
    ping: state => state.pinging = true,
    pong: state => state.pinging = false
  },
  actions: {
    ping: observableAction((action$, { commit }) => {
      action$.subscribe(() => commit('ping'))
      action$.delay(1000).subscribe(() => commit('pong'))
    })
  }
})

TODOs

  • Working with multiple actions as source
  • Adaptors
  • Cancellation
  • HMR support
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].