Nuxt/test/fixtures/basic/composables/random.ts
pooya parsa 888bd7c145
feat(nuxt): payload rendering support (#6455)
Co-authored-by: Daniel Roe <daniel@roe.dev>
2022-09-10 15:57:16 +02:00

4 lines
148 B
TypeScript

export function useRandomState (max: number = 100, name = 'default') {
return useState('random:' + name, () => Math.round(Math.random() * max))
}