docs/.vitepress/theme/composables/useEffects.ts

11 lines · 314 bytes

1 symbol in this file
 1import { useStorage } from '@vueuse/core'
 2import { computed } from 'vue'
 3
 4import { EffectsStorageKey } from '../constants'
 5
 6export function useEffects() {
 7  const effects = useStorage(EffectsStorageKey, 'off')
 8  const effectsEnabled = computed(() => effects.value === 'on')
 9
10  return { effects, effectsEnabled }
11}