Closed joeldenning closed 4 years ago
Sometimes I want to apply a class if it’s present. You can do this with maybe(), but you actually have to do maybe(myKlass || ‘’, myKlass) in order for kremling to not get mad about a false className. I think an easier apis would be this:
whenTruthy(myKlass)
Turns out that always() already supports this. If the argument provided to always is not a string, it defaults to an empty string.
always()
Sometimes I want to apply a class if it’s present. You can do this with maybe(), but you actually have to do maybe(myKlass || ‘’, myKlass) in order for kremling to not get mad about a false className. I think an easier apis would be this:
whenTruthy(myKlass)