diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index a39cab48..ed3c6d9b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,5 +1,7 @@ --- -name: Bug report about: Create a report to help us improve title: '' +name: + Bug report about: + Create a report to help us improve title: '' labels: '' assignees: '' diff --git a/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateArrowExtension.kt b/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateArrowExtension.kt index 70c45224..2d0db74e 100644 --- a/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateArrowExtension.kt +++ b/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateArrowExtension.kt @@ -20,7 +20,6 @@ import arrow.core.Either import arrow.core.raise.either import com.fraktalio.fmodel.application.Error.CommandHandlingFailed import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.* /** @@ -31,7 +30,6 @@ import kotlinx.coroutines.flow.* * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun EventSourcingAggregate.handleWithEffect(command: C): Flow> = command .fetchEvents() @@ -49,7 +47,6 @@ fun EventSourcingAggregate.handleWithEffect(command: C): Flow * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingOrchestratingAggregate.handleWithEffect(command: C): Flow> = command .fetchEvents() @@ -66,7 +63,6 @@ fun EventSourcingOrchestratingAggregate.handleWithEffect(comm * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun EventSourcingLockingAggregate.handleOptimisticallyWithEffect(command: C): Flow>> = flow { val events = command.fetchEvents() @@ -88,7 +84,6 @@ fun EventSourcingLockingAggregate.handleOptimisticallyW * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingLockingOrchestratingAggregate.handleOptimisticallyWithEffect(command: C): Flow>> = command .fetchEvents().map { it.first } @@ -99,67 +94,55 @@ fun EventSourcingLockingOrchestratingAggregate.handleOp @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingAggregate.handleWithEffect(commands: Flow): Flow> = commands .flatMapConcat { handleWithEffect(it) } .catch { emit(either { raise(CommandHandlingFailed(it)) }) } @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingOrchestratingAggregate.handleWithEffect(commands: Flow): Flow> = commands .flatMapConcat { handleWithEffect(it) } .catch { emit(either { raise(CommandHandlingFailed(it)) }) } @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingLockingAggregate.handleOptimisticallyWithEffect(commands: Flow): Flow>> = commands .flatMapConcat { handleOptimisticallyWithEffect(it) } .catch { emit(either { raise(CommandHandlingFailed(it)) }) } @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingLockingOrchestratingAggregate.handleOptimisticallyWithEffect(commands: Flow): Flow>> = commands .flatMapConcat { handleOptimisticallyWithEffect(it) } .catch { emit(either { raise(CommandHandlingFailed(it)) }) } -@FlowPreview fun C.publishWithEffect(aggregate: EventSourcingAggregate): Flow> = aggregate.handleWithEffect(this) @ExperimentalCoroutinesApi -@FlowPreview fun C.publishWithEffect(aggregate: EventSourcingOrchestratingAggregate): Flow> = aggregate.handleWithEffect(this) -@FlowPreview fun C.publishOptimisticallyWithEffect(aggregate: EventSourcingLockingAggregate): Flow>> = aggregate.handleOptimisticallyWithEffect(this) @ExperimentalCoroutinesApi -@FlowPreview fun C.publishOptimisticallyWithEffect(aggregate: EventSourcingLockingOrchestratingAggregate): Flow>> = aggregate.handleOptimisticallyWithEffect(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishWithEffect(aggregate: EventSourcingAggregate): Flow> = aggregate.handleWithEffect(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishWithEffect(aggregate: EventSourcingOrchestratingAggregate): Flow> = aggregate.handleWithEffect(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishOptimisticallyWithEffect(aggregate: EventSourcingLockingAggregate): Flow>> = aggregate.handleOptimisticallyWithEffect(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishOptimisticallyWithEffect(aggregate: EventSourcingLockingOrchestratingAggregate): Flow>> = aggregate.handleOptimisticallyWithEffect(this) diff --git a/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerArrowExtension.kt b/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerArrowExtension.kt index 8edc741c..c91604d8 100644 --- a/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerArrowExtension.kt +++ b/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerArrowExtension.kt @@ -21,7 +21,6 @@ import arrow.core.raise.either import com.fraktalio.fmodel.application.Error.ActionResultHandlingFailed import com.fraktalio.fmodel.application.Error.ActionResultPublishingFailed import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.flatMapConcat @@ -51,7 +50,6 @@ fun SagaManager.handleWithEffect(actionResult: AR): Flow SagaManager.handleWithEffect(actionResults: Flow): Flow> = actionResults .flatMapConcat { handleWithEffect(it) } @@ -78,7 +76,6 @@ fun AR.publishWithEffect(sagaManager: SagaManager): Flow Flow.publishWithEffect(sagaManager: SagaManager): Flow> = sagaManager.handleWithEffect(this) diff --git a/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateArrowExtension.kt b/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateArrowExtension.kt index 17972972..d4d60443 100644 --- a/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateArrowExtension.kt +++ b/application-arrow/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateArrowExtension.kt @@ -20,7 +20,6 @@ import arrow.core.Either import arrow.core.raise.catch import arrow.core.raise.either import com.fraktalio.fmodel.application.Error.* -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.catch import kotlinx.coroutines.flow.map @@ -33,7 +32,6 @@ import kotlinx.coroutines.flow.map * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview suspend fun I.handleWithEffect(command: C): Either where I : StateComputation, I : StateRepository { /** @@ -97,7 +95,6 @@ suspend fun I.handleWithEffect(command: C): Either where * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview suspend fun I.handleOptimisticallyWithEffect(command: C): Either> where I : StateComputation, I : StateLockingRepository { /** @@ -162,7 +159,6 @@ suspend fun I.handleOptimisticallyWithEffect(command: C): Either * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun I.handleWithEffect(commands: Flow): Flow> where I : StateComputation, I : StateRepository = commands @@ -177,7 +173,6 @@ fun I.handleWithEffect(commands: Flow): Flow> w * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun I.handleOptimisticallyWithEffect(commands: Flow): Flow>> where I : StateComputation, I : StateLockingRepository = commands @@ -192,7 +187,6 @@ fun I.handleOptimisticallyWithEffect(commands: Flow): Flow C.publishWithEffect(aggregate: A): Either where A : StateComputation, A : StateRepository = aggregate.handleWithEffect(this) @@ -205,7 +199,6 @@ suspend fun C.publishWithEffect(aggregate: A): Either whe * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview suspend fun C.publishOptimisticallyWithEffect(aggregate: A): Either> where A : StateComputation, A : StateLockingRepository = aggregate.handleOptimisticallyWithEffect(this) @@ -218,7 +211,6 @@ suspend fun C.publishOptimisticallyWithEffect(aggregate: A): Eit * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun Flow.publishWithEffect(aggregate: A): Flow> where A : StateComputation, A : StateRepository = aggregate.handleWithEffect(this) @@ -231,7 +223,6 @@ fun Flow.publishWithEffect(aggregate: A): Flow> * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun Flow.publishOptimisticallyWithEffect(aggregate: A): Flow>> where A : StateComputation, A : StateLockingRepository = aggregate.handleOptimisticallyWithEffect(this) diff --git a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt index 2d5dc3a9..60b873ac 100644 --- a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt +++ b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt @@ -20,14 +20,12 @@ import com.fraktalio.fmodel.domain.examples.numbers.odd.command.oddNumberDecider import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.toList /** * DSL - Given */ -@FlowPreview private fun IDecider.given( repository: EventRepository, command: () -> C @@ -37,7 +35,6 @@ private fun IDecider.given( eventRepository = repository ).handleWithEffect(command()) -@FlowPreview private fun IDecider.given( repository: EventLockingRepository, command: () -> C @@ -66,7 +63,6 @@ private suspend infix fun Flow>>.thenEventPairs( * Event sourced aggregate test */ @OptIn(ExperimentalCoroutinesApi::class) -@FlowPreview class EventSourcedAggregateTest : FunSpec({ val evenDecider = evenNumberDecider() val oddDecider = oddNumberDecider() diff --git a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt index a3a46406..2ac934cc 100644 --- a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt +++ b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt @@ -20,12 +20,10 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import io.kotest.matchers.types.shouldBeInstanceOf import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview /** * DSL - Given */ -@FlowPreview private suspend fun IDecider.given( repository: StateRepository, command: () -> C @@ -35,7 +33,6 @@ private suspend fun IDecider.given( stateRepository = repository ).handleWithEffect(command()) -@FlowPreview private suspend fun IDecider.given( repository: StateLockingRepository, command: () -> C @@ -83,7 +80,6 @@ private fun Either.thenError() { * State-stored aggregate test */ @OptIn(ExperimentalCoroutinesApi::class) -@FlowPreview class StateStoredAggregateTest : FunSpec({ val evenDecider = evenNumberDecider() val oddDecider = oddNumberDecider() diff --git a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt index 29e2e7d8..d0070bd7 100644 --- a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt +++ b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt @@ -29,7 +29,6 @@ import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent.OddNumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.OddNumberState import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview /** @@ -42,7 +41,7 @@ import kotlinx.coroutines.FlowPreview * @param repository the event-sourcing repository for all (even and odd) numbers * @return the event-sourcing aggregate instance for all (even and odd) numbers */ -@OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) fun numberAggregate( evenNumberDecider: Decider, oddNumberDecider: Decider, diff --git a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt index bb31c6fe..be01f5e5 100644 --- a/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt +++ b/application-arrow/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt @@ -29,7 +29,6 @@ import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent.OddNumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.OddNumberState import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview /** @@ -42,7 +41,7 @@ import kotlinx.coroutines.FlowPreview * @param repository the state-stored repository for all (even and odd) numbers * @return the state-stored aggregate instance for all (even and odd) numbers */ -@OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) fun numberStateStoredAggregate( evenNumberDecider: Decider, oddNumberDecider: Decider, diff --git a/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateExtension.kt b/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateExtension.kt index 285f5bf4..9a8a8039 100644 --- a/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateExtension.kt +++ b/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateExtension.kt @@ -17,7 +17,6 @@ package com.fraktalio.fmodel.application import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.* /** @@ -28,7 +27,6 @@ import kotlinx.coroutines.flow.* * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun EventSourcingAggregate.handle(command: C): Flow = command .fetchEvents() @@ -44,7 +42,6 @@ fun EventSourcingAggregate.handle(command: C): Flow = * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingOrchestratingAggregate.handle(command: C): Flow = command .fetchEvents() @@ -59,7 +56,6 @@ fun EventSourcingOrchestratingAggregate.handle(command: C): F * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun EventSourcingLockingAggregate.handleOptimistically(command: C): Flow> = flow { val events = command.fetchEvents() emitAll( @@ -78,7 +74,6 @@ fun EventSourcingLockingAggregate.handleOptimistically( * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingLockingOrchestratingAggregate.handleOptimistically(command: C): Flow> = command .fetchEvents().map { it.first } @@ -87,61 +82,49 @@ fun EventSourcingLockingOrchestratingAggregate.handleOp @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingAggregate.handle(commands: Flow): Flow = commands.flatMapConcat { handle(it) } @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingOrchestratingAggregate.handle(commands: Flow): Flow = commands.flatMapConcat { handle(it) } @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingLockingAggregate.handleOptimistically(commands: Flow): Flow> = commands.flatMapConcat { handleOptimistically(it) } @ExperimentalCoroutinesApi -@FlowPreview fun EventSourcingLockingOrchestratingAggregate.handleOptimistically(commands: Flow): Flow> = commands.flatMapConcat { handleOptimistically(it) } -@FlowPreview fun C.publishTo(aggregate: EventSourcingAggregate): Flow = aggregate.handle(this) -@FlowPreview fun C.publishOptimisticallyTo(aggregate: EventSourcingLockingAggregate): Flow> = aggregate.handleOptimistically(this) @ExperimentalCoroutinesApi -@FlowPreview fun C.publishTo(aggregate: EventSourcingOrchestratingAggregate): Flow = aggregate.handle(this) @ExperimentalCoroutinesApi -@FlowPreview fun C.publishOptimisticallyTo(aggregate: EventSourcingLockingOrchestratingAggregate): Flow> = aggregate.handleOptimistically(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishTo(aggregate: EventSourcingAggregate): Flow = aggregate.handle(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishOptimisticallyTo(aggregate: EventSourcingLockingAggregate): Flow> = aggregate.handleOptimistically(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishTo(aggregate: EventSourcingOrchestratingAggregate): Flow = aggregate.handle(this) @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishOptimisticallyTo(aggregate: EventSourcingLockingOrchestratingAggregate): Flow> = aggregate.handleOptimistically(this) \ No newline at end of file diff --git a/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerExtension.kt b/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerExtension.kt index 1df8fcf2..8e6777d8 100644 --- a/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerExtension.kt +++ b/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/SagaManagerExtension.kt @@ -17,7 +17,6 @@ package com.fraktalio.fmodel.application import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flatMapConcat @@ -40,7 +39,6 @@ fun SagaManager.handle(actionResult: AR): Flow = actionResult. * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ExperimentalCoroutinesApi -@FlowPreview fun SagaManager.handle(actionResults: Flow): Flow = actionResults.flatMapConcat { handle(it) } /** @@ -62,5 +60,4 @@ fun AR.publishTo(sagaManager: SagaManager): Flow = sagaManager * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ExperimentalCoroutinesApi -@FlowPreview fun Flow.publishTo(sagaManager: SagaManager): Flow = sagaManager.handle(this) diff --git a/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateExtension.kt b/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateExtension.kt index 0b80335d..f8464e79 100644 --- a/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateExtension.kt +++ b/application-vanilla/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateExtension.kt @@ -16,7 +16,6 @@ package com.fraktalio.fmodel.application -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map @@ -28,7 +27,6 @@ import kotlinx.coroutines.flow.map * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview suspend fun I.handle(command: C): S where I : StateComputation, I : StateRepository = command.fetchState().computeNewState(command).save() @@ -41,7 +39,6 @@ suspend fun I.handle(command: C): S where I : StateComputation I.handleOptimistically(command: C): Pair where I : StateComputation, I : StateLockingRepository { val (state, version) = command.fetchState() @@ -58,7 +55,6 @@ suspend fun I.handleOptimistically(command: C): Pair where * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun I.handle(commands: Flow): Flow where I : StateComputation, I : StateRepository = commands.map { handle(it) } @@ -71,7 +67,6 @@ fun I.handle(commands: Flow): Flow where I : StateComputation * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun I.handleOptimistically(commands: Flow): Flow> where I : StateComputation, I : StateLockingRepository = commands.map { handleOptimistically(it) } @@ -85,7 +80,6 @@ fun I.handleOptimistically(commands: Flow): Flow> * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview suspend fun C.publishTo(aggregate: A): S where A : StateComputation, A : StateRepository = aggregate.handle(this) @@ -98,7 +92,6 @@ suspend fun C.publishTo(aggregate: A): S where A : StateComputation * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview suspend fun C.publishOptimisticallyTo(aggregate: A): Pair where A : StateComputation, A : StateLockingRepository = aggregate.handleOptimistically(this) @@ -111,7 +104,6 @@ suspend fun C.publishOptimisticallyTo(aggregate: A): Pair * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun Flow.publishTo(aggregate: A): Flow where A : StateComputation, A : StateRepository = aggregate.handle(this) @@ -124,7 +116,6 @@ fun Flow.publishTo(aggregate: A): Flow where A : StateComputa * * @author Иван Дугалић / Ivan Dugalic / @idugalic */ -@FlowPreview fun Flow.publishOptimisticallyTo(aggregate: A): Flow> where A : StateComputation, A : StateLockingRepository = aggregate.handleOptimistically(this) \ No newline at end of file diff --git a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt index 4ec854fb..3fcbde9f 100644 --- a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt +++ b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateTest.kt @@ -23,21 +23,18 @@ import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.toList /** * DSL - Given */ -@FlowPreview private fun IDecider.given(repository: EventRepository, command: () -> C): Flow = EventSourcingAggregate( decider = this, eventRepository = repository ).handle(command()) -@FlowPreview private fun IDecider.given( repository: EventLockingRepository, command: () -> C @@ -47,7 +44,6 @@ private fun IDecider.given( eventRepository = repository ).handleOptimistically(command()) -@FlowPreview private fun IDecider.given( saga: ISaga, repository: EventRepository, @@ -77,7 +73,6 @@ private suspend infix fun Flow>.thenEventPairs(expected: Itera * Event sourced aggregate test */ @ExperimentalCoroutinesApi -@FlowPreview class EventSourcedAggregateTest : FunSpec({ val evenDecider = evenNumberDecider() val oddDecider = oddNumberDecider() diff --git a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt index b2128343..95f638b9 100644 --- a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt +++ b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateTest.kt @@ -19,19 +19,16 @@ import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview /** * DSL - Given */ -@FlowPreview private suspend fun IDecider.given(repository: StateRepository, command: () -> C): S = StateStoredAggregate( decider = this, stateRepository = repository ).handle(command()) -@FlowPreview private suspend fun IDecider.given( repository: StateLockingRepository, command: () -> C @@ -57,7 +54,6 @@ private infix fun Pair.thenStateAndVersion(expected: Pair) = * State-stored aggregate test */ @OptIn(ExperimentalCoroutinesApi::class) -@FlowPreview class StateStoredAggregateTest : FunSpec({ val evenDecider = evenNumberDecider() val oddDecider = oddNumberDecider() diff --git a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt index ec50234c..e07c30ca 100644 --- a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt +++ b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberEventSourcedAggregate.kt @@ -29,7 +29,6 @@ import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent.OddNumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.OddNumberState import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview /** @@ -42,7 +41,7 @@ import kotlinx.coroutines.FlowPreview * @param repository the event-sourcing repository for all (even and odd) numbers * @return the event-sourcing aggregate instance for all (even and odd) numbers */ -@OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) fun numberAggregate( evenNumberDecider: Decider, oddNumberDecider: Decider, diff --git a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt index 33ac77a0..26e333dc 100644 --- a/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt +++ b/application-vanilla/src/commonTest/kotlin/com/fraktalio/fmodel/application/examples/numbers/NumberStateStoredAggregate.kt @@ -29,7 +29,6 @@ import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.NumberEvent.OddNumberEvent import com.fraktalio.fmodel.domain.examples.numbers.api.OddNumberState import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview /** @@ -42,7 +41,7 @@ import kotlinx.coroutines.FlowPreview * @param repository the state-stored repository for all (even and odd) numbers * @return the state-stored aggregate instance for all (even and odd) numbers */ -@OptIn(FlowPreview::class, ExperimentalCoroutinesApi::class) +@OptIn(ExperimentalCoroutinesApi::class) fun numberStateStoredAggregate( evenNumberDecider: Decider, oddNumberDecider: Decider, diff --git a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateActorExtension.kt b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateActorExtension.kt index 05237ecd..1e6c0837 100644 --- a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateActorExtension.kt +++ b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregateActorExtension.kt @@ -2,7 +2,6 @@ package com.fraktalio.fmodel.application import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.SendChannel @@ -30,7 +29,6 @@ import kotlin.math.absoluteValue */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun EventSourcingAggregate.handleConcurrently( commands: Flow, numberOfActors: Int = 100, @@ -71,7 +69,6 @@ fun EventSourcingAggregate.handleConcurrently( */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun Flow.publishConcurrentlyTo( aggregate: EventSourcingAggregate, numberOfActors: Int = 100, diff --git a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorExtension.kt b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorExtension.kt index 116946f4..ad857c57 100644 --- a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorExtension.kt +++ b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorExtension.kt @@ -18,7 +18,6 @@ package com.fraktalio.fmodel.application import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.SendChannel @@ -47,7 +46,6 @@ import kotlin.math.absoluteValue */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun MaterializedView.handleConcurrently( events: Flow, numberOfActors: Int = 100, @@ -86,7 +84,6 @@ fun MaterializedView.handleConcurrently( * @author Иван Дугалић / Ivan Dugalic / @idugalic */ @ObsoleteCoroutinesApi -@FlowPreview @ExperimentalContracts fun Flow.publishConcurrentlyTo( materializedView: MaterializedView, diff --git a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/SagaManagerActorExtension.kt b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/SagaManagerActorExtension.kt index 64326a34..fe8263ac 100644 --- a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/SagaManagerActorExtension.kt +++ b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/SagaManagerActorExtension.kt @@ -18,7 +18,6 @@ package com.fraktalio.fmodel.application import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.SendChannel @@ -46,7 +45,6 @@ import kotlin.math.absoluteValue */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun SagaManager.handleConcurrently( actionResults: Flow, numberOfActors: Int = 100, @@ -85,7 +83,6 @@ fun SagaManager.handleConcurrently( */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun Flow.publishConcurrentlyTo( sagaManager: SagaManager, numberOfActors: Int = 100, diff --git a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorExtension.kt b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorExtension.kt index c88170c4..d63107a4 100644 --- a/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorExtension.kt +++ b/application-vanilla/src/jvmMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorExtension.kt @@ -18,7 +18,6 @@ package com.fraktalio.fmodel.application import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineStart -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.channels.SendChannel @@ -46,7 +45,6 @@ import kotlin.math.absoluteValue */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun StateStoredAggregate.handleConcurrently( commands: Flow, numberOfActors: Int = 100, @@ -85,7 +83,6 @@ fun StateStoredAggregate.handleConcurrently( */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview fun Flow.publishConcurrentlyTo( aggregate: StateStoredAggregate, numberOfActors: Int = 100, diff --git a/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateActorTest.kt b/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateActorTest.kt index 69368944..f034630b 100644 --- a/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateActorTest.kt +++ b/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/EventSourcedAggregateActorTest.kt @@ -12,7 +12,6 @@ import io.kotest.assertions.throwables.shouldThrow import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainAll import io.kotest.matchers.collections.shouldContainExactly -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf @@ -24,7 +23,6 @@ import kotlin.contracts.ExperimentalContracts */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview private fun IDecider.given( repository: EventRepository, partitionKey: (C) -> Int, @@ -54,7 +52,6 @@ private suspend infix fun Flow.thenEvents(expected: Collection) = toLi */ @OptIn(ObsoleteCoroutinesApi::class) @ExperimentalContracts -@FlowPreview class EventSourcedAggregateActorTest : FunSpec({ val evenDecider = evenNumberDecider() val evenNumberRepository = evenNumberRepository() as EvenNumberRepository diff --git a/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorTest.kt b/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorTest.kt index 6cd15206..c6344093 100644 --- a/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorTest.kt +++ b/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/MaterializedViewActorTest.kt @@ -17,7 +17,6 @@ import com.fraktalio.fmodel.domain.examples.numbers.odd.query.oddNumberView import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainAll import io.kotest.matchers.collections.shouldContainExactly -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf @@ -28,7 +27,6 @@ import kotlin.contracts.ExperimentalContracts * DSL - Given */ @ObsoleteCoroutinesApi -@FlowPreview @ExperimentalContracts private fun IView.given( repository: ViewStateRepository, @@ -56,7 +54,6 @@ private suspend infix fun Flow.thenState(expected: Collection) = toLis * Materialized View Actor Test */ @OptIn(ObsoleteCoroutinesApi::class) -@FlowPreview @ExperimentalContracts class MaterializedViewActorTest : FunSpec({ val evenView = evenNumberView() diff --git a/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorTest.kt b/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorTest.kt index 38748339..b697774c 100644 --- a/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorTest.kt +++ b/application-vanilla/src/jvmTest/kotlin/com/fraktalio/fmodel/application/StateStoredAggregateActorTest.kt @@ -18,7 +18,6 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainAll import io.kotest.matchers.collections.shouldContainExactly import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.ObsoleteCoroutinesApi import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flowOf @@ -30,7 +29,6 @@ import kotlin.contracts.ExperimentalContracts */ @ObsoleteCoroutinesApi @ExperimentalContracts -@FlowPreview private fun IDecider.given( repository: StateRepository, partitionKey: (C) -> Int, @@ -58,7 +56,6 @@ private suspend infix fun Flow.thenState(expected: Collection) = toLis */ @OptIn(ObsoleteCoroutinesApi::class, ExperimentalCoroutinesApi::class) @ExperimentalContracts -@FlowPreview class StateStoredAggregateActorTest : FunSpec({ val evenDecider = evenNumberDecider() val oddDecider = oddNumberDecider() diff --git a/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregate.kt b/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregate.kt index d86c4bdb..2be1d930 100644 --- a/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregate.kt +++ b/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/EventSourcingAggregate.kt @@ -19,14 +19,12 @@ package com.fraktalio.fmodel.application import com.fraktalio.fmodel.domain.IDecider import com.fraktalio.fmodel.domain.ISaga import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.* /** * `EventComputation` interface formalizes the `Event Computation` algorithm / event sourced system by using a `decider` of type [IDecider]<[C], [S], [E]> to handle commands based on the current events, and produce new events. */ interface EventComputation : IDecider { - @FlowPreview fun Flow.computeNewEvents(command: C): Flow = flow { val currentState = fold(initialState) { s, e -> evolve(s, e) } val resultingEvents = decide(command, currentState) @@ -40,7 +38,6 @@ interface EventComputation : IDecider { */ interface EventOrchestratingComputation : ISaga, IDecider { @ExperimentalCoroutinesApi - @FlowPreview fun Flow.computeNewEventsByOrchestrating(command: C, fetchEvents: (C) -> Flow): Flow = flow { val currentState = fold(initialState) { s, e -> evolve(s, e) } var resultingEvents = decide(command, currentState) diff --git a/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregate.kt b/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregate.kt index 25952541..8a89a6c1 100644 --- a/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregate.kt +++ b/application/src/commonMain/kotlin/com/fraktalio/fmodel/application/StateStoredAggregate.kt @@ -19,7 +19,6 @@ package com.fraktalio.fmodel.application import com.fraktalio.fmodel.domain.IDecider import com.fraktalio.fmodel.domain.ISaga import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.collect import kotlinx.coroutines.flow.flatMapConcat import kotlinx.coroutines.flow.fold @@ -35,7 +34,6 @@ interface StateComputation : IDecider { * @param command of type [C] * @return The newly computed state of type [S] */ - @FlowPreview suspend fun S?.computeNewState(command: C): S { val currentState = this ?: initialState val events = decide(command, currentState) @@ -96,7 +94,6 @@ interface StateOrchestratingComputation : ISaga, StateComputation * @return The newly computed state of type [S] */ @ExperimentalCoroutinesApi - @FlowPreview override suspend fun S?.computeNewState(command: C): S { val currentState = this ?: initialState val events = decide(command, currentState) diff --git a/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Decider.kt b/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Decider.kt index 9a9ea55f..7261f2c7 100644 --- a/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Decider.kt +++ b/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Decider.kt @@ -20,7 +20,6 @@ import com.fraktalio.fmodel.domain.internal.InternalDecider import com.fraktalio.fmodel.domain.internal.asDecider import com.fraktalio.fmodel.domain.internal.combine import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.emptyFlow @@ -141,7 +140,6 @@ data class Decider( * @return [Decider]<[C_SUPER], [Pair]<[S], [S2]>, [E_SUPER]> */ @ExperimentalCoroutinesApi -@FlowPreview inline infix fun Decider.combine( y: Decider ): Decider, E_SUPER?> = diff --git a/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Saga.kt b/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Saga.kt index b7881546..5385cbce 100644 --- a/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Saga.kt +++ b/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/Saga.kt @@ -17,7 +17,6 @@ package com.fraktalio.fmodel.domain import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flattenConcat import kotlinx.coroutines.flow.flowOf @@ -154,7 +153,6 @@ data class Saga( * @return new Saga of type `[Saga]<[AR_SUPER], [A_SUPER]>` */ @ExperimentalCoroutinesApi -@FlowPreview inline infix fun Saga.combine( y: Saga ): Saga { diff --git a/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/internal/InternalDecider.kt b/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/internal/InternalDecider.kt index 9aff7162..bfb0eba4 100644 --- a/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/internal/InternalDecider.kt +++ b/domain/src/commonMain/kotlin/com/fraktalio/fmodel/domain/internal/InternalDecider.kt @@ -2,7 +2,6 @@ package com.fraktalio.fmodel.domain.internal import com.fraktalio.fmodel.domain.Decider import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.flattenConcat import kotlinx.coroutines.flow.flowOf @@ -135,7 +134,6 @@ internal data class InternalDecider( * @return new decider of type [InternalDecider]<[C], [Si], [Son], [Ei], [Eo]> */ @ExperimentalCoroutinesApi -@FlowPreview internal fun InternalDecider.applyOnState( ff: InternalDecider Son, Ei, Eo> ): InternalDecider = InternalDecider( @@ -158,7 +156,6 @@ internal fun InternalDecider.applyOn * @return new decider of type [InternalDecider]<[C], [Si], [Pair]<[So], [Son]>, [Ei], [Eo]> */ @ExperimentalCoroutinesApi -@FlowPreview @PublishedApi internal fun InternalDecider.productOnState( fb: InternalDecider @@ -193,7 +190,6 @@ internal fun InternalDecider.product @ExperimentalCoroutinesApi @PublishedApi -@FlowPreview internal inline infix fun InternalDecider.combine( y: InternalDecider ): InternalDecider, Pair, Ei_SUPER, Eo_SUPER?> { diff --git a/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/DeciderTest.kt b/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/DeciderTest.kt index 4e0fcb24..be8dada5 100644 --- a/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/DeciderTest.kt +++ b/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/DeciderTest.kt @@ -19,7 +19,6 @@ import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly import io.kotest.matchers.shouldBe import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.fold import kotlinx.coroutines.flow.toList @@ -42,7 +41,6 @@ private suspend infix fun Flow.thenEvents(expected: Iterable) = toList private infix fun S.thenState(expected: U?) = shouldBe(expected) @OptIn(ExperimentalCoroutinesApi::class) -@FlowPreview class DeciderTest : FunSpec({ val evenDecider = evenNumberDecider() val oddDecider = oddNumberDecider() diff --git a/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/SagaTest.kt b/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/SagaTest.kt index c827d819..4dca75b7 100644 --- a/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/SagaTest.kt +++ b/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/SagaTest.kt @@ -12,7 +12,6 @@ import com.fraktalio.fmodel.domain.examples.numbers.oddNumberSaga import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.collections.shouldContainExactly import kotlinx.coroutines.ExperimentalCoroutinesApi -import kotlinx.coroutines.FlowPreview import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.toList @@ -20,7 +19,6 @@ private fun ISaga.whenActionResult(actionResults: AR) = react(act private suspend infix fun Flow.expectActions(expected: Iterable) = toList() shouldContainExactly (expected) @OptIn(ExperimentalCoroutinesApi::class) -@FlowPreview class SagaTest : FunSpec({ val evenSaga = evenNumberSaga() val oddSaga = oddNumberSaga() diff --git a/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/ViewTest.kt b/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/ViewTest.kt index fe613c29..61dd1ed5 100644 --- a/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/ViewTest.kt +++ b/domain/src/commonTest/kotlin/com/fraktalio/fmodel/domain/ViewTest.kt @@ -10,14 +10,12 @@ import com.fraktalio.fmodel.domain.examples.numbers.even.query.evenNumberView import com.fraktalio.fmodel.domain.examples.numbers.odd.query.oddNumberView import io.kotest.core.spec.style.FunSpec import io.kotest.matchers.shouldBe -import kotlinx.coroutines.FlowPreview private fun IView.givenEvents(events: Iterable) = events.fold(initialState) { s, e -> evolve(s, e) } private infix fun S.thenState(expected: U?) = shouldBe(expected) -@FlowPreview class ViewTest : FunSpec({ val evenView = evenNumberView() val oddView = oddNumberView()