anthonyshort / deku

Render interfaces using pure functions and virtual DOM
https://github.com/anthonyshort/deku/tree/master/docs
3.41k stars 130 forks source link

Don't treat `0` as a falsy value #357

Closed gillstrom closed 8 years ago

gillstrom commented 8 years ago

Is there any better way to check for falsy values except numbers?

Fixes #354.

anthonyshort commented 8 years ago

You could potentially just check for string or number types, since they're the only ones that you want rendered as text anyway. It was mainly just to stop values like false, objects, undefined, null etc from rendering as text.

gillstrom commented 8 years ago

Changed the check to check for string or number.

anthonyshort commented 8 years ago

Thanks!