Skip to content

Instantly share code, notes, and snippets.

@TheBotBox
Created June 5, 2020 14:35
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 TheBotBox/43587ef07c3024de4f8e71b2b384e5c4 to your computer and use it in GitHub Desktop.
Save TheBotBox/43587ef07c3024de4f8e71b2b384e5c4 to your computer and use it in GitHub Desktop.
inline fun <reified T> Any.ofType(block: (T) -> Unit) {
if (this is T) {
block(this as T)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment