LaunchPadLab / lp-utils

Our Utilities
MIT License
1 stars 0 forks source link

Add `set` functionality to `toggle` #25

Closed dpikt closed 7 years ago

dpikt commented 7 years ago

In addition to <toggleName>Active and toggle<toggleName>() I think we should have a set<toggleName>() that takes a boolean to set the toggle. Otherwise you end up with stuff like this:

function showModal (doShow) {
    if ((doShow && !shownActive) || (!doShow && shownActive)) toggleShown()
}
dpikt commented 7 years ago

@davemcorwin what do you think?

davemcorwin commented 7 years ago

sounds reasonable.