github.com/covergates/covergates@v0.2.2-0.20201009050117-42ef8a19fb95/web/src/store/modules/report/mutations.ts (about) 1 import { ReportState } from '.'; 2 3 export function setCurrent(state: ReportState, report: Report): void { 4 state.current = report; 5 } 6 7 export function setHistory(state: ReportState, reports: Report[]): void { 8 state.history.splice(0, state.history.length); 9 state.history.push(...reports); 10 } 11 12 export function startLoading(state: ReportState): void { 13 state.loading = true; 14 } 15 16 export function stopLoading(state: ReportState): void { 17 state.loading = false; 18 } 19 20 export function setSource(state: ReportState, source: string): void { 21 state.source = source; 22 } 23 24 export function setError(state: ReportState, error: Error): void { 25 state.error = error; 26 }