A super tiny class serializer
$ npm install cls-str
import cls from 'cls-str';
cls({ foo:true, bar:false, baz: isTrue() });
//=> 'foo baz'
cls('form-field', { success: 1 > 0 }, [ 'color-whilte', 'bg-black' ], 'dup', 'dup', null);
//=> 'form-field success color-whilte bg-black dup'
import React from 'react';
import cls from 'cls-str';
const TodoItem = ({ text, isDone, disabled }) => (
<li className={ cls({ item:true, completed:isDone, disabled }) }>
<input type="checkbox" disabled={ disabled } checked={ isDone } />
<label>{ text }</label>
</li>
);
- Fork this Repo first
- Clone your Repo
- Install dependencies by
$ npm install
- Checkout a feature branch
- Feel free to add your features
- Make sure your features are fully tested
- Publish your local branch, Open a pull request
- Enjoy hacking <3
This work is licensed under the MIT license.