Created
August 23, 2016 07:25
-
-
Save Jire/193bfb805f7cae477bb4c4b0255f0ea4 to your computer and use it in GitHub Desktop.
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
| class Predicator<out RESULT>(val predicate: () -> RESULT?) { | |
| operator inline fun invoke(crossinline whenTrue: RESULT.() -> Unit) { | |
| val result = predicate() ?: return | |
| result.whenTrue() | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment