Skip to content

Instantly share code, notes, and snippets.

@charlesmuchene
Created February 21, 2020 04:47
Show Gist options
  • Select an option

  • Save charlesmuchene/ae5db33bb76c8bb4bb00660abd5bf3a0 to your computer and use it in GitHub Desktop.

Select an option

Save charlesmuchene/ae5db33bb76c8bb4bb00660abd5bf3a0 to your computer and use it in GitHub Desktop.
Single method invocable usecase
interface UseCase {
operator fun invoke()
}
class UseCaseImpl: UseCase {
override fun invoke() {
println("Invalidate cache")
}
}
val usecase: UseCase = UseCaseImpl()
usecase()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment