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

Add toggle method for easy enable/disable #21

Open
MadLittleMods opened this issue Feb 10, 2016 · 1 comment
Open

Add toggle method for easy enable/disable #21

MadLittleMods opened this issue Feb 10, 2016 · 1 comment

Comments

@MadLittleMods
Copy link

Add toggle method for easy enable/disable. This makes it easy to set based based on a variable.

Current:

var somebool;
autoLauncher[(somebool ? 'enable' : 'disable')](function(err) {
   console.log(err);
});
// or
(somebool ? autoLauncher.enable : autoLauncher.disable).bind(autoLauncher)(function(err){
   console.log(err);
});

Desired:

var somebool;
autoLauncher.toggle(somebool, function(err) {
   console.log(err);
});
@4ver
Copy link
Member

4ver commented Apr 4, 2016

This isn't a priority for us but we'll happily accept a pr for this change. Thanks for the suggestion!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants