@aarongraston/classtoggle
v2.0.10
Published
allows an object to hold a class to toggle on a document node object when this is passed in.
Maintainers
Readme
classtoggle
construct an object that will toggle a class you pass to it's constructor. Works on document node objects.
Install
$ npm install @aarongraston/classtoggleUsage
import classToggle from '@aarongraston/classtoggle';
hideToggle = classToggle('class-name');
elementToHide = document.querySelector('#myElement');
elementToHide.addEventListener('click', hideToggle.toggle.bind(elementToHide));