Generate random numbers that are consecutively unique
Useful for things like slideshows where you don't want to have the same slide twice in a row.
# npm
npm install --save @elonehoo/only-random
# yarn
yarn add --save @elonehoo/only-random
# pnpm
pnpm install --save @elonehoo/only-random
import onlyRandom from '@elonehoo/only-random'
const random = onlyRandom(1, 10)
console.log(random(), random(), random())
onlyRandom(minimum:number, maximum:number)
Returns a function, that when called, will return a random number that is never the same as the previous.