Skip to content

Instantly share code, notes, and snippets.

@etoxin
Created December 11, 2017 01:50
Show Gist options
  • Save etoxin/330320c8587c9b9774f24f061161eb92 to your computer and use it in GitHub Desktop.
Save etoxin/330320c8587c9b9774f24f061161eb92 to your computer and use it in GitHub Desktop.
ClassList Helper
/**
* 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