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 toggleClass() to the animation abstraction #59

Open
estaylorco opened this issue Apr 4, 2017 · 0 comments
Open

Add toggleClass() to the animation abstraction #59

estaylorco opened this issue Apr 4, 2017 · 0 comments

Comments

@estaylorco
Copy link

I'm submitting a feature request

  • Library Version:
    1.0.1

Please tell us about your environment:

  • Operating System:
    OSX 10.x

  • Node Version:
    7.3.0

  • NPM Version:
    3.10.10
  • JSPM OR Webpack AND Version
    JSPM 0.16.53
  • Browser:
    all

  • Language:
    ESNext

Current behavior:
Presently, the animation abstraction offers up addClass() and removeClass(). This leads to code like this:

if (reveal) {
   this.animator.addClass(...);
else {
   this.animator.removeClass(...);
}

Not the end of the world, but a little verbose.

Expected/desired behavior:
I would suggest a toggleClass() method on the abstraction. It is certainly in keeping with many of the animation libraries out there, including jQuery's, and it would allow the above to be reduced to:

this.animator.toggleClass(...);
  • What is the motivation / use case for changing the behavior?
    Terseness, clarity, and harmony with many animation libraries' conventional approach.
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

2 participants