selectLogic

inline suspend fun <L : ModuleLogic> StoreAccessor.selectLogic(): L(source)

Selects a module's logic instance by its type.

Use this to access another module's logic for cross-module operations.

Example:

class OrderLogic(private val storeAccessor: StoreAccessor) : ModuleLogic() {
suspend fun processOrder() {
val paymentLogic = storeAccessor.selectLogic<PaymentLogic>()
paymentLogic.processPayment(amount)
}
}

Return

The logic instance of the requested type

Throws

if no module with the specified logic type is registered