From 4001338256bd2ae41cbc3ca8556888e24a16ca64 Mon Sep 17 00:00:00 2001 From: Jimly-Firdaus <13521102@std.stei.itb.ac.id> Date: Wed, 12 Apr 2023 18:45:28 +0700 Subject: [PATCH] feat: add path in string to store --- src/store/index.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/store/index.ts b/src/store/index.ts index 2c77cea..4902412 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -4,12 +4,14 @@ import { Path } from 'src/composables'; interface State { pathRetrieved: Path[]; allPosition: Path[]; + pathInString: string; } export default createStore({ state: { pathRetrieved: [], allPosition: [], + pathInString: "", }, mutations: { setPathRetrieved(state, pathRetrieved: Path[]) { @@ -18,6 +20,9 @@ export default createStore({ setAllPosition(state, allPosition: Path[]) { state.allPosition = allPosition; }, + setPathInString(state, pathInString: string) { + state.pathInString = pathInString; + } }, actions: { updatePathRetrieved({ commit }, pathRetrieved: Path[]) { @@ -26,5 +31,8 @@ export default createStore({ updateAllPosition({ commit }, allPosition: Path[]) { commit('setAllPosition', allPosition); }, + updatePathInString({ commit }, pathInString: string) { + commit('setPathInString', pathInString); + }, }, }); \ No newline at end of file