From 06b72f57bab9e5223688fd3e7137234bd3ab9b10 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Wed, 12 May 2021 17:32:46 +0200 Subject: [PATCH] docs: testing actions devtools --- docs/.vitepress/components/ThemeToggle.vue | 12 ++++++++++++ docs/.vitepress/stores/counter.ts | 13 +++++++++++++ 2 files changed, 25 insertions(+) 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 -- 2.47.3