Spaces:
Paused
Paused
Download src/stores/counter.ts from bryanorlas/learning: direct link, hf CLI and curl.
- Browser
- Download file 306 Bytes
-
https://huggingface.co/spaces/bryanorlas/learning/resolve/main/src/stores/counter.ts
- Command line
-
hf download hf://spaces/bryanorlas/learning/src/stores/counter.ts
-
curl -L -o counter.ts https://huggingface.co/spaces/bryanorlas/learning/resolve/main/src/stores/counter.ts
306 Bytes
| import { ref, computed } from 'vue' | |
| import { defineStore } from 'pinia' | |
| export const useCounterStore = defineStore('counter', () => { | |
| const count = ref(0) | |
| const doubleCount = computed(() => count.value * 2) | |
| function increment() { | |
| count.value++ | |
| } | |
| return { count, doubleCount, increment } | |
| }) | |