vuex-xhr-state
Version:
Use Vuex to manage the state of you're ajax calls.
36 lines (35 loc) • 1.1 kB
TypeScript
import { ActionContext } from 'vuex';
import { IVxsMutationPayload } from './types';
export declare const GLOBAL_NAMESPACE = "globalXhrState";
export declare const GLOBAL_ACTIONS: {
REQUEST: string;
RECEIVED: string;
FAILED: string;
RESET_ERROR: string;
};
export declare const GLOBAL_GETTERS: {
ANY_PENDING: string;
ANY_ERROR: string;
LAST_ERROR_RESPONSE: string;
};
interface IGlobalState {
activeLoaders: string[];
last_error: object;
}
export declare const globalStore: {
namespaced: boolean;
state: {
activeLoaders: never[];
last_error: {};
};
getters: {
[x: string]: ((state: IGlobalState) => boolean) | ((state: IGlobalState) => object);
};
actions: {
[x: string]: (({ commit }: ActionContext<unknown, unknown>, key: string) => void) | (({ commit }: ActionContext<unknown, unknown>, payload: IVxsMutationPayload) => void);
};
mutations: {
[x: string]: ((state: IGlobalState, key: string) => void) | ((state: IGlobalState, payload: IVxsMutationPayload) => void);
};
};
export {};