Last active
November 20, 2016 00:06
-
-
Save nesbtesh/72d4896a20d89f2ebbaa7e8171641476 to your computer and use it in GitHub Desktop.
React render if true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const isFunction = input => typeof input === 'function'; | |
export default predicate => elemOrThunk => | |
predicate ? (isFunction(elemOrThunk) ? elemOrThunk() : elemOrThunk) : null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment