setup stores and vitest

This commit is contained in:
Michael Dausmann
2023-11-28 00:28:19 +11:00
parent 7e46acf449
commit d8f20d9896
9 changed files with 1436 additions and 211 deletions

View File

@@ -2,12 +2,6 @@ import { Note } from '.prisma/client';
import { defineStore, storeToRefs } from 'pinia';
import { Ref } from 'vue';
/*
Note) the Notes Store needs to be a 'Setup Store' (https://pinia.vuejs.org/core-concepts/#setup-stores)
because this enables the use of the watch on the Account Store
If the UI does not need to dynamically respond to a change in the active Account e.g. if state is always retrieved with an explicit fetch after onMounted.
then an Options store can be used.
*/
export const useNotesStore = defineStore('notes', () => {
const accountStore = useAccountStore();
const { activeAccountId } = storeToRefs(accountStore);