-
-
Notifications
You must be signed in to change notification settings - Fork 765
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
customAlphabet in nanoid/async/index.browser is not actually async #228
Comments
Yeap, it is sync, since browser do not have async API. We have it just for compatibility. I like the idea to document it. Can you send PR? |
Replace `generate()` in v2 with `customAlphabet()` in v3, so that we can more easily adopt future versions of nanoid - map `generateShortUrl` directly to `customAlphabet()` - ai/nanoid#228 suggests that `customAlphabet()` is not async, so make `generateShortUrl()` synchronous, and change CreateLinkForm to account for this This is a follow-up commit for dependabot
I would love to, though I would like to raise the following to clarify the issue, for your consideration:
I've filed #229 to address this, in light of the above. |
Replace `generate()` in v2 with `customAlphabet()` in v3, so that we can more easily adopt future versions of nanoid - map `generateShortUrl` directly to `customAlphabet()` - ai/nanoid#228 suggests that `customAlphabet()` is not async, so make `generateShortUrl()` synchronous, and change CreateLinkForm to account for this This is a follow-up commit for dependabot
Visual comparison of
customAlphabet()
between/index.browser.js
and/async/index.browser.js
suggests that the async version is really synchronous. This should either be changed to at least return a Promise, or documented.The text was updated successfully, but these errors were encountered: