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

Could we add a feature into @swc-jotai/debug-label so that this provides a fallback but otherwise uses a .debugLabel if one already exists? #32

Open
sebinsua opened this issue Jun 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@sebinsua
Copy link

sebinsua commented Jun 20, 2024

Could we add a feature into @swc-jotai/debug-label so that this provides a fallback label but otherwise uses a .debugLabel if one already exists?

e.g.

countAtom.debugLabel = countAtom.debugLabel ?? "countAtom";

The reason I'm interested in this, is that, often when I'm using atom families to create atoms, I give each atom a parameterised debug label relating to the params it was initialised with, etc.

I might attempt creating this if you're interested in the feature...

Note: I've just seen that one of your tests is that you don't add a label if one already exists, however, this doesn't work for me as I am using a helper function to apply debugLabel and debugPrivate.

@Thisen Thisen added the enhancement New feature or request label Aug 5, 2024
@Thisen
Copy link
Collaborator

Thisen commented Aug 5, 2024

Good idea. Give it a shot and let's see if we like it.

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

No branches or pull requests

2 participants