Reimplementation of classnames in ReasonML.
# yarn
yarn add re-classnames
# or npm
npm install --save re-classnames
Then add it to bsconfig.json
:
"bs-dependencies": [
"re-classnames"
]
Cn.make(["one", "two"]) // => "one two"
Cn.make(["one", "two"->Cn.ifTrue(true)]) // => "one two"
Cn.make(["one", "two"->Cn.ifTrue(false)]) // => "one"
Cn.make(["one", "two"->Cn.ifSome(Some("thing"))]) // => "one two"
Cn.make(["one", "two"->Cn.ifSome(None)]) // => "one"
type t =
| One
| Two
| Tree;
Cn.make([
"one",
Cn.mapSome(
Some(Two),
fun
| One => "one"
| Two => "two"
| Tree => "three",
)
]) // => "one two"
Cn.make([
"one",
Cn.mapSome(
None,
fun
| One => "one"
| Two => "two"
| Tree => "three",
)
]) // => "one"
Cn.make(["one", Some("two")->Cn.unpack]) // => "one two"
Cn.make(["one", None->Cn.unpack]) // => "one"
MIT.