Nuxt/test/fixtures/basic/composables/random.ts

4 lines
148 B
TypeScript
Raw Normal View History

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