KlerkModels

interface KlerkModels<C : KlerkContext, V>

Functions

Link copied to clipboard
abstract fun subscribe(context: C, id: ModelID<out Any>?): Flow<ModelModification>

Subscribes to model changes.

Link copied to clipboard
abstract suspend fun <T : Any> unsafeCreate(context: C, model: Model<T>)

Creates a model without using a state machine. This is an 'escape hatch', and should be used only as a last resort. No validation and no authorization rules will be applied.

Link copied to clipboard
abstract suspend fun <T : Any> unsafeDelete(context: C, id: ModelID<T>)

Deletes a model without using a state machine. This is an 'escape hatch', and should be used only as a last resort. No validation and no authorization rules will be applied.

Link copied to clipboard
abstract suspend fun <T : Any> unsafeUpdate(context: C, model: Model<T>)

Updates a model without using a state machine. This is an 'escape hatch', and should be used only as a last resort. No validation and no authorization rules will be applied.