import { defineStore } from 'pinia'

export const useAppStore = defineStore({
    id: 'app',
    state: () => ({
        hasData: false,
        answers: [],
        playbooks: {},
        results: {},
        scores: {},
        count: null
    }),
    actions: {
        toggleData() {
            this.hasData = !this.hasData
            console.log('Toggled Has Data. New value', this.hasData)
        },
        store(key, data) {
            this[key] = JSON.parse(JSON.stringify(data))
        }
    }
})