Skip to content

Instantly share code, notes, and snippets.

@cioccarellia
Created July 28, 2020 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cioccarellia/5626043a4001c1f46bf2d810bddb30b3 to your computer and use it in GitHub Desktop.
Save cioccarellia/5626043a4001c1f46bf2d810bddb30b3 to your computer and use it in GitHub Desktop.
/**
* Calls the specified function [block] with `this` value as its receiver and returns `this` value.
*/
public inline fun <T> T.apply(block: T.() -> Unit): T {
block()
return this
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment