nextcloud-app-radio/src/store.js

30 lines
567 B
JavaScript
Raw Normal View History

2020-10-23 15:49:24 +00:00
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
2020-10-23 20:18:05 +00:00
state: {
player: {
isPlaying: false,
isBuffering: false,
volume: 0,
},
2020-10-23 15:49:24 +00:00
},
mutations: {
2020-10-23 20:18:05 +00:00
isPlaying(state, playerState) {
state.player.isPlaying = playerState
},
isBuffering(state, bufferingState) {
state.player.isBuffering = bufferingState
},
},
actions: {
isPlaying(context, playerState) {
context.commit('isPlaying', playerState)
},
isBuffering(context, bufferingState) {
context.commit('isBuffering', bufferingState)
2020-10-23 15:49:24 +00:00
},
},
})