Skip to content

Commit

Permalink
feat: add path in string to store
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimly-Firdaus committed Apr 12, 2023
1 parent dae221a commit 4001338
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { Path } from 'src/composables';
interface State {
pathRetrieved: Path[];
allPosition: Path[];
pathInString: string;
}

export default createStore<State>({
state: {
pathRetrieved: [],
allPosition: [],
pathInString: "",
},
mutations: {
setPathRetrieved(state, pathRetrieved: Path[]) {
Expand All @@ -18,6 +20,9 @@ export default createStore<State>({
setAllPosition(state, allPosition: Path[]) {
state.allPosition = allPosition;
},
setPathInString(state, pathInString: string) {
state.pathInString = pathInString;
}
},
actions: {
updatePathRetrieved({ commit }, pathRetrieved: Path[]) {
Expand All @@ -26,5 +31,8 @@ export default createStore<State>({
updateAllPosition({ commit }, allPosition: Path[]) {
commit('setAllPosition', allPosition);
},
updatePathInString({ commit }, pathInString: string) {
commit('setPathInString', pathInString);
},
},
});

0 comments on commit 4001338

Please sign in to comment.