From 4034b01670db7f9c8c13e4c031f0fc9859a2d4ee Mon Sep 17 00:00:00 2001 From: Jens Christian Aanestad <jenscaa@stud.ntnu.no> Date: Sat, 20 Apr 2024 15:23:49 +0200 Subject: [PATCH] feat/Created new configuration store --- src/stores/ConfigurationStore.ts | 38 ++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/stores/ConfigurationStore.ts diff --git a/src/stores/ConfigurationStore.ts b/src/stores/ConfigurationStore.ts new file mode 100644 index 0000000..fb9e0dd --- /dev/null +++ b/src/stores/ConfigurationStore.ts @@ -0,0 +1,38 @@ +import { defineStore } from 'pinia' +export const useConfigurationStore = defineStore('ConfigurationStore', { + state: () => ({ + commitment: '', + experience: '', + challenges: [] + }), + actions: { + setCommitment(commitment: string) { + this.commitment = commitment + }, + setExperience(experience: string) { + this.experience = experience + }, + setChallenges(challenges: Array<string>) { + this.challenges = challenges + }, + resetConfiguration() { + this.commitment = '' + this.experience = '' + this.challenges = [] + } + }, + getters: { + getCommitment(): string { + return this.commitment + }, + getExperience(): string { + return this.experience + }, + getChallenges(): string { + return this.challenges + } + }, + persist: { + enabled: true, + } +}); -- GitLab