import { ActionTree } from "vuex"; import { AppState } from "./types"; const actions: ActionTree = { // Add one or more sources addSources({ commit, dispatch }, sources: EventSource[]) { // Commit to state immediately commit("appendSources", sources); // Start fetching from each new source sources.forEach(x => dispatch("fetchFromSource", x.url)); }, // Fetch events from a source url async fetchFromSource({ commit }, url: string) { //TODO } }; export default actions;