Created
January 8, 2019 14:28
-
-
Save rock3r/2918eab9d0bbb8aaa26a479a367770c1 to your computer and use it in GitHub Desktop.
This file contains 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
package me.seebrock3r.util | |
/** | |
* Calls the specified function [block] as a side effect of a previous expression. | |
* | |
* This is similar to [run] in that it's used to chain side effects, but it | |
* doesn't return anything and the block doesn't have any parameters. If your | |
* side effects require either of those things, use [run] or [also] instead. | |
* | |
* @see run | |
* @see also | |
*/ | |
@Suppress("unused") // We don't really need the Any receiver but we want to keep fluency | |
inline fun Any.andThen(block: () -> Unit) { | |
block() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment