Created
December 11, 2017 01:50
-
-
Save etoxin/330320c8587c9b9774f24f061161eb92 to your computer and use it in GitHub Desktop.
ClassList Helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Class helper | |
* @param className | |
* @param method | |
* @param element | |
* @returns {*} | |
* @example curry(classHelper)('myClass')('contains') | |
* @example curry(classHelper)('myClass')('add') | |
* @example curry(classHelper)('myClass')('remove') | |
*/ | |
let classHelper = function (className, method, element) { | |
return element.classList[method](className); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment