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

monotonicFactory() as the standard { ulid } export? #50

Open
m59peacemaker opened this issue Feb 22, 2025 · 0 comments
Open

monotonicFactory() as the standard { ulid } export? #50

m59peacemaker opened this issue Feb 22, 2025 · 0 comments

Comments

@m59peacemaker
Copy link

m59peacemaker commented Feb 22, 2025

I once created a bug with:

import { ulid } from 'ulidx'

rather than:

import { monotonicFactory } from 'ulidx'
const ulid = monotonicFactory()

This can be a devastating bug in cases where order is vital. Would you consider making it so that import { ulid } from 'ulidx' gives you ulid = monotonicFactory()? If not, what about this for more convenience?

import { ulid } from 'ulidx/monotonic'

I'm unsure why the version of ulid without the monotonic increase guarantee is desirable at all.

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

1 participant