WithJob

interface WithJob

Marks a class that it has a Job to start coroutines with.

Inheritors

Properties

Link copied to clipboard
abstract val job: Job

Job for launching coroutines in.

Functions

Link copied to clipboard
open fun errorHandler(cause: Throwable)

Default error handler printing the error to console.

Link copied to clipboard
open infix fun <A> Flow<A>.handledBy(handler: Handler<A>)

Connects a Flow to a Handler.

open infix fun <A> Flow<A>.handledBy(execute: suspend (A) -> Unit): Job
open infix fun <E : Event> Flow<E>.handledBy(execute: suspend (E) -> Unit): Job

Connects a Flow to a suspendable execute function.

open infix fun <E : Event> Flow<E>.handledBy(handler: Handler<Unit>)

Connects Events to a Handler.

Link copied to clipboard
fun <T> WithJob.history(capacity: Int = 0, initialValue: List<T> = emptyList(), job: Job = this.job): History<T>

factory-method to create a History

Link copied to clipboard
fun <D> WithJob.storeOf(initialData: D, job: Job = this.job, id: String = Id.next()): Store<D>

Convenience function to create a simple Store without any handlers, etc.

fun <D, M> WithJob.storeOf(initialData: D, validation: Validation<D, Unit, M>, job: Job = this.job, id: String = Id.next()): ValidatingStore<D, Unit, M>

Convenience function to create a simple ValidatingStore without any metadata and handlers.

fun <D, T, M> WithJob.storeOf(initialData: D, validation: Validation<D, T, M>, metadataDefault: T, job: Job = this.job, id: String = Id.next()): ValidatingStore<D, T, M>

Convenience function to create a simple ValidatingStore without any handlers, etc.