Last active
April 26, 2018 11:02
-
-
Save ditn/f0b7a385fe749174efb9d007f7b2586f to your computer and use it in GitHub Desktop.
naive_high_order_extension
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
private fun NotificationCompat.Builder.ternaryBuilder( | |
predicate: () -> Boolean, | |
trueFunc: NotificationCompat.Builder.() -> NotificationCompat.Builder, | |
falseFunc: NotificationCompat.Builder.() -> NotificationCompat.Builder | |
): NotificationCompat.Builder = if (predicate()) this.trueFunc() else this.falseFunc() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment