I hereby claim:
- I am jonatbergn on github.
- I am jonathanbergen (https://keybase.io/jonathanbergen) on keybase.
- I have a public key ASDULjd4Eq1yBVjK9dKjZnyg2GMmOxEv4WOyqMKBxtgidAo
To claim this, I am signing this object:
package com.jonathanbergen | |
import kotlinx.coroutines.Job | |
import kotlinx.coroutines.coroutineScope | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.FlowCollector | |
import kotlinx.coroutines.flow.distinctUntilChanged | |
import kotlinx.coroutines.flow.first | |
import kotlinx.coroutines.flow.flow | |
import kotlinx.coroutines.flow.onStart |
import kotlinx.coroutines.CoroutineDispatcher | |
import kotlinx.coroutines.flow.Flow | |
import kotlinx.coroutines.flow.MutableStateFlow | |
import kotlinx.coroutines.flow.StateFlow | |
import kotlinx.coroutines.flow.update | |
import kotlinx.coroutines.invoke | |
interface UseCase<State, Action> { | |
val actions: Flow<Action> |
class Milk | |
class Beans | |
class Powder | |
class Water | |
class Coffee(water: Water, powder: Powder) | |
sealed interface BrewResult { | |
class Success(val coffee: Coffee) : BrewResult | |
sealed interface Failure : BrewResult { | |
object InsufficientPowder : Failure |
typealias Given<Input> = (Input) -> Boolean | |
infix fun <Input, Violation> Given<Input>.violates(violation: Violation): (Input) -> Violation? = | |
{ if (invoke(it)) violation else null } | |
fun <Input> given(checkForFailure: Input.() -> Boolean) = checkForFailure | |
fun <Input, Violation> validatorOf(vararg criteria: (Input) -> Violation?): (Input) -> List<Violation> = | |
{ input -> criteria.mapNotNull { it(input) } } |
I hereby claim:
To claim this, I am signing this object: