feat: add frontend
This commit is contained in:
10
frontend/utils/api.ts
Normal file
10
frontend/utils/api.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { NuxtAxiosInstance } from '@nuxtjs/axios'
|
||||
|
||||
/* eslint import/no-mutable-exports: 0 */
|
||||
let $axios: NuxtAxiosInstance;
|
||||
|
||||
export function initializeAxios(axiosInstance: NuxtAxiosInstance) {
|
||||
$axios = axiosInstance
|
||||
}
|
||||
|
||||
export { $axios }
|
12
frontend/utils/store-accessor.ts
Normal file
12
frontend/utils/store-accessor.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import {Store} from 'vuex'
|
||||
import {getModule} from 'vuex-module-decorators'
|
||||
import Quiz from "~/store/quiz";
|
||||
|
||||
/* eslint import/no-mutable-exports: 0 */
|
||||
let quizStore: Quiz;
|
||||
|
||||
function initialiseStores(store: Store<any>): void {
|
||||
quizStore = getModule(Quiz, store);
|
||||
}
|
||||
|
||||
export {initialiseStores, quizStore}
|
Reference in New Issue
Block a user