From: Eduardo San Martin Morote Date: Wed, 12 May 2021 15:32:46 +0000 (+0200) Subject: docs: testing actions devtools X-Git-Tag: v2.0.0-alpha.17~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06b72f57bab9e5223688fd3e7137234bd3ab9b10;p=thirdparty%2Fvuejs%2Fpinia.git docs: testing actions devtools --- diff --git a/docs/.vitepress/components/ThemeToggle.vue b/docs/.vitepress/components/ThemeToggle.vue index 9f4cfc3a..30a7a16a 100644 --- a/docs/.vitepress/components/ThemeToggle.vue +++ b/docs/.vitepress/components/ThemeToggle.vue @@ -58,6 +58,18 @@

Counter :{{ counterStore.n }}

+ + + diff --git a/docs/.vitepress/stores/counter.ts b/docs/.vitepress/stores/counter.ts index 27ad109b..c4827136 100644 --- a/docs/.vitepress/stores/counter.ts +++ b/docs/.vitepress/stores/counter.ts @@ -9,6 +9,7 @@ export const useCounter = defineStore({ n: 0, incrementedTimes: 0, decrementedTimes: 0, + numbers: [] as number[], }), getters: { @@ -24,6 +25,18 @@ export const useCounter = defineStore({ this.n += amount }, + async fail() { + const n = this.n + await delay(1000) + this.numbers.push(n) + await delay(1000) + if (this.n !== n) { + throw new Error('Someone changed n!') + } + + return n + }, + async decrementToZero(interval: number = 300, usePatch = true) { if (this.n <= 0) return