Skip to content

add uniq Map for generated ID #3644

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

Merged
merged 1 commit into from
Feb 13, 2018
Merged

add uniq Map for generated ID #3644

merged 1 commit into from
Feb 13, 2018

Conversation

PxyUp
Copy link
Contributor

@PxyUp PxyUp commented Feb 13, 2018

Good day, to the best of our knowledge, a unique element must have context. Let's say each person is unique, they can be numbered, like cats, dogs and the like

uniqueId("cat") // "cat1"
uniqueId("cat") // "cat2"
uniqueId("dog") // "dog1"
uniqueId("dog") // "dog2"
uniqueId() // "1"
uniqueId() // "2"

@jdalton
Copy link
Member

jdalton commented Feb 13, 2018

I like this @PxyUp!

Thank you!

@jdalton jdalton merged commit 7f24cab into lodash:master Feb 13, 2018
@StreetStrider
Copy link
Contributor

That's awesome, but where's the test? @PxyUp

@jdalton
Copy link
Member

jdalton commented Feb 13, 2018

The test debt will need to be paid soon. I'm wrapping up @std/esm v1 so that means I'll be able to focus more on Lodash v5.

@falsyvalues
Copy link
Contributor

I think we should alter also description .

@omeid
Copy link

omeid commented Feb 16, 2018

Why does it matter for the uniqueId to be serial?

@PxyUp
Copy link
Contributor Author

PxyUp commented Feb 16, 2018

@omeid because uniq id, can be only in context. Do not worry with backwards compatibility everything will work also

@falsyvalues
Copy link
Contributor

@omeid @PxyUp Worth to mention that this is the cheapest implementation that guarantee unique id in context.

@lock
Copy link

lock bot commented Feb 16, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

5 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy