Created
June 5, 2018 17:35
-
-
Save anthony2025/dd964c1e535c746cdb09cae4197d5e32 to your computer and use it in GitHub Desktop.
for use inside compose/flow statements, branches based on a 'predicate' (more precisely just a boolean value)
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
export const conditional = <T>(predicate: boolean, ifTrue: T => *, ifFalse: T => *) => | |
(value: T) => predicate ? ifTrue(value) : ifFalse(value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment