Skip to content

Instantly share code, notes, and snippets.

View DenysZP's full-sized avatar

Denys Makhov DenysZP

  • Ukraine
View GitHub Profile
@DenysZP
DenysZP / UseCase.kt
Created March 28, 2019 12:06
The implementation of the base UseCase with kotlin coroutines.
import kotlinx.coroutines.*
import kotlin.coroutines.CoroutineContext
abstract class UseCase<T, Params : Any> {
private lateinit var parentJob: Job
private lateinit var params: Params
private var isAttachedToLifecycle = false
private val backgroundContext: CoroutineContext = Dispatchers.IO
private val foregroundContext: CoroutineContext = Dispatchers.Main
@DenysZP
DenysZP / 0_reuse_code.js
Created September 25, 2015 22:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console