Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Working #8

Closed
NIV54 opened this issue Oct 17, 2020 · 3 comments
Closed

Not Working #8

NIV54 opened this issue Oct 17, 2020 · 3 comments

Comments

@NIV54
Copy link

NIV54 commented Oct 17, 2020

Just installed the package, cool idea BTW!
Unfortunately I think it's not working correctly.
the following code:

import uniqueRandom from "unique-random";

const random = uniqueRandom(1, 4);
console.log(random(), random(), random(), random());

sometimes has bad results (i.e 1, 2, 4, 2 or 4, 1, 3, 4). I've noticed it's never the same number twice in a row if that's helpfull.

@sindresorhus
Copy link
Owner

What is incorrect exactly?

From the description:

Generate random numbers that are consecutively unique

@NIV54
Copy link
Author

NIV54 commented Oct 17, 2020

My bad. I was looking for a package that will return a different number from the range in each random() call.
You can close this issue.

@sindresorhus
Copy link
Owner

I'm open to having that ability added, but I don't plan to work on this myself. #9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants