swc-jotai
swc-jotai copied to clipboard
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?
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.
Good idea. Give it a shot and let's see if we like it.