@f/apply-classes
v1.0.1
Published
Apply classes to an element from an object map
Downloads
4
Readme
apply-classes
Apply classes to an element from an object map
Installation
$ npm install @f/apply-classes
Usage
var applyClasses = require('@f/apply-classes')
applyClasses({
show: true,
hide: false
})
API
applyClasses(map, element)
map
- An object containing class names as keys and boolean values indicating whether they should be added or removed.element
- The DOM node you want to apply the class name operations inmap
to.
Returns: element
License
MIT