Advertisement
Guest User

Untitled

a guest
May 19th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. const bem = (className, config = {}) => {
  2. return Object.entries(config).reduce((result, [key, value]) => {
  3. if (value) {
  4. return result.concat(`${className}--${key}${typeof value !== "boolean" ? `-${value}` : ""}`);
  5. }
  6.  
  7. return result;
  8. }, [className]).join(" ");
  9. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement