-
Notifications
You must be signed in to change notification settings - Fork 0
Adds createTerm() utility function.
#5
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
Conversation
Co-authored-by: Hugo Drelon <69580439+Hug0-Drelon@users.noreply.github.com>
Co-authored-by: Hugo Drelon <69580439+Hug0-Drelon@users.noreply.github.com>
Allows calling createTerm() without arguments, generating names like "Term 1", "Term 2", etc.
| if ( ! defaultArgs.name ) { | ||
| defaultArgs.name = `Term ${ ++termCounter }`; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can add it directly in defaultArgs definition, right before the spread operator. Am I right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not if we want to increment the counter only when needed. Putting it in defaultArgs would increment the counter even when args.name is provided, wasting numbers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I see, my bad.
All in the title.