Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.