Closed Staijn1 closed 1 year ago
Hey @Staijn1 !
Thanks for the PR. I agree the parameter name should be more clear (I suck at choosing variable names 😅), but I think mustEnable
can be misleading as well, because when it's set to false
it will actually stop the analyzer.
For similar native methods, force
seems to be a standard parameter name in the JavaScript docs:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/togglePopover https://developer.mozilla.org/en-US/docs/Web/API/Element/toggleAttribute https://developer.mozilla.org/en-US/docs/Web/API/DOMTokenList/toggle
And jQuery uses state
for this parameter name in a similar method, which also seems like a good choice.
https://api.jquery.com/toggleClass/#toggleClass-className-state
What do you think?
I will admit, I was not completely sold on mustEnable
either..
I asked my, (maybe our) best friend ChatGPT for any other suggestions and he came back with the following:
However, judging by the MDN documentation I think we should go with force
to be consistent with native Javascript functions. Although activate
in my opinion is not bad either.
Sticking with force
seems good to me!
Suggested changes are pushed! :)
Hey!
I found myself wondering if the parameter of
toggleAnalyzer
enabled, or disabled the analyzer. The only thing this PR does is change it's name to be more descriptive, and add some comments.I don't think the README.md needs to be updated.