From c68d70b4cdcc9c3caf2736c04822939465411f37 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Mon, 31 Jul 2023 09:17:41 +0200 Subject: [PATCH] chore: add playground files --- .../playground/domain/one/stores/testStore.ts | 4 ++++ packages/nuxt/playground/stores/counter.ts | 17 +++++++++++++++++ .../nuxt/playground/stores/nested/some-store.ts | 8 ++++++++ 3 files changed, 29 insertions(+) create mode 100644 packages/nuxt/playground/domain/one/stores/testStore.ts create mode 100644 packages/nuxt/playground/stores/counter.ts create mode 100644 packages/nuxt/playground/stores/nested/some-store.ts diff --git a/packages/nuxt/playground/domain/one/stores/testStore.ts b/packages/nuxt/playground/domain/one/stores/testStore.ts new file mode 100644 index 00000000..b4affbe1 --- /dev/null +++ b/packages/nuxt/playground/domain/one/stores/testStore.ts @@ -0,0 +1,4 @@ +export const useTestStore = defineStore('test', () => { + console.log('I was defined within a store directory') + return {} +}) diff --git a/packages/nuxt/playground/stores/counter.ts b/packages/nuxt/playground/stores/counter.ts new file mode 100644 index 00000000..02c82c74 --- /dev/null +++ b/packages/nuxt/playground/stores/counter.ts @@ -0,0 +1,17 @@ +export const useCounter = defineStore('counter', { + state: () => ({ + count: 100, + }), + actions: { + increment() { + this.count += 1 + }, + }, + getters: { + getCount: (state) => state.count, + }, +}) + +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useCounter, import.meta.hot)) +} diff --git a/packages/nuxt/playground/stores/nested/some-store.ts b/packages/nuxt/playground/stores/nested/some-store.ts new file mode 100644 index 00000000..b5cf2c1c --- /dev/null +++ b/packages/nuxt/playground/stores/nested/some-store.ts @@ -0,0 +1,8 @@ +export const useSomeStoreStore = defineStore('some-store', () => { + console.log('I was defined within a nested store directory') + return {} +}) + +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useSomeStoreStore, import.meta.hot)) +} -- 2.47.2