typescriptVueintermediate

Vue 3 Composition API Composable

Ref, computed, and reactive state management in Vue 3

By ApeType Staff·17 lines·367 characters·1,420 total attempts
SOURCE CODE·typescript
import { ref, computed } from "vue"; export function useCounter(initialValue: number = 0) { const count = ref<number>(initialValue); const doubleCount = computed(() => count.value * 2); function increment() { count.value++; } function decrement() { if (count.value > 0) { count.value--; } } return { count, doubleCount, increment, decrement }; }
UTF-8 · Tab indentationStandard Strict Parsing
TRANSCRIBE

Ready when you are.

Test your muscle memory and transcription speed against this exact snippet.

Start Typing
Tip: Press Esc anytime to restart

Best runs on this snippet

#TypistAccWPM
1Abel Gideon95.6%70
2Abel Gideon95.6%70
3Abel Gideon98.29%69
4Abel Gideon98.29%69
5Henok Yoseph93.71%54