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

feat(core): introduce lib to generate ids #7

Open
gabrieleAngius opened this issue May 25, 2023 · 0 comments
Open

feat(core): introduce lib to generate ids #7

gabrieleAngius opened this issue May 25, 2023 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@gabrieleAngius
Copy link
Collaborator

gabrieleAngius commented May 25, 2023

Is your feature request related to a problem? Please describe.
Currently we are using as id of items stored on our state the ID of the first instance created. It's not an huge problem but it's confusing since we often run in the following situation:

const instance = figma.createComponent() // returns something like: { id: 'AA' ... }
const newStateItem = {
  id: instance.id,
  name: '...'
  refIds: [instance.id]
}

Describe the solution you'd like
A nice solution could be to use libraries such as uuid to be sure the id of the state is not equal as one instance

example:

const instance = figma.createComponent() // returns something like: { id: 'AA' ... }
const newStateItem = {
  id: uuid(),
  name: '...'
  refIds: [instance.id]
}
@gabrieleAngius gabrieleAngius added enhancement New feature or request good first issue Good for newcomers labels May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant