node-auto-launch icon indicating copy to clipboard operation
node-auto-launch copied to clipboard

Feature 21 add toggle method

Open dstutemann opened this issue 1 year ago • 4 comments

Target Platform

  • Windows
  • Mac
  • Linux

What Problem does this solve?

This adds functionality requested in issue #21

Could it break existing functionality

No, this just adds a new function and does not modify existing functions

Additional Info

I have tested this using a test project on Windows and macOS. Somebody should test it on Linux as I am not a Linux user.

dstutemann avatar Feb 17 '24 15:02 dstutemann

Hi @dstutemann

Would it be simple and as efficient to use toggle() without any parameter? First, toggling is expected to change a given state to another one. Secondly, toggling with a parameter seems redundant to the enable() and disabled() methods, unless I'm missing something.

Also, I'm wondering if this should be added to the 5.x.x branch or the 6.x.x branch, which got rid of coffeescript. While we could add it to the 5.x.x branch, I don't know if we want to add/port new features to it?

Oxalin avatar Mar 19 '24 03:03 Oxalin

Hi @Oxalin, I added the optional parameter value as it was requested in the issue. If you don't specify a parameter the function will toggle the state to the opposite, if you specify a parameter it will toggle to the desired state.

Unfortunately I can't see the 6.x.x branch.

I took the issue because it was marked as "good first issue". Feel free to close this PR if you decide that the feature isn't needed anymore.

dstutemann avatar Mar 20 '24 16:03 dstutemann

I think the feature would simplify some logic that many apps need to implement.

Under Code > Tags, the latest entry is 6.0.0-rc1.

Oxalin avatar Mar 21 '24 21:03 Oxalin

I'll keep this PR opened until we add it directly under the new JS code. Once 6.0.0 is out the door, I'll add it to 6.1.0

Oxalin avatar Apr 06 '24 16:04 Oxalin