Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vuejs/vuex-observable
Consume Vuex actions as Observables using RxJS 5
https://github.com/vuejs/vuex-observable
Last synced: about 1 month ago
JSON representation
Consume Vuex actions as Observables using RxJS 5
- Host: GitHub
- URL: https://github.com/vuejs/vuex-observable
- Owner: vuejs
- License: mit
- Archived: true
- Created: 2016-11-29T06:55:19.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-12-25T22:59:43.000Z (almost 6 years ago)
- Last Synced: 2024-04-14T04:19:41.685Z (7 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 155
- Watchers: 48
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-state - vuex-observable
- awesome-vue-js - Vuex Observable
README
# 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](https://github.com/redux-observable/redux-observable).
## Usage
``` js
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