Skip to content

Commit

Permalink
fix: koin-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
y9vad9 committed Aug 4, 2023
1 parent c744787 commit c8d1f32
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ import org.koin.core.scope.Scope
* @return The created instance of the state machine.
*/
@Composable
actual inline fun <TState : UiState, TEvent : UiEvent, TEffect : UiEffect> stateMachine(
actual inline fun <TState : UiState, TEvent : UiEvent, TEffect : UiEffect, reified TSM : AbstractStateMachine<TState, TEvent, TEffect>> stateMachine(
noinline parameters: ParametersDefinition?,
): StateMachine<TState, TEvent, TEffect> = koinVM(parameters = parameters)
): StateMachine<TState, TEvent, TEffect> = koinVM<TSM>(parameters = parameters)

@OptIn(KoinInternalApi::class)
@PublishedApi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ import org.koin.core.parameter.ParametersDefinition
* @return The created instance of the state machine.
*/
@Composable
expect inline fun <TState : UiState, TEvent : UiEvent, TEffect : UiEffect> stateMachine(
expect inline fun <TState : UiState, TEvent : UiEvent, TEffect : UiEffect, reified TSM : AbstractStateMachine<TState, TEvent, TEffect>> stateMachine(
noinline parameters: ParametersDefinition? = null,
): StateMachine<TState, TEvent, TEffect>
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import org.koin.compose.koinInject
import org.koin.core.parameter.ParametersDefinition

@Composable
actual inline fun <TState : UiState, TEvent : UiEvent, TEffect : UiEffect> stateMachine(
actual inline fun <TState : UiState, TEvent : UiEvent, TEffect : UiEffect, reified TSM : AbstractStateMachine<TState, TEvent, TEffect>> stateMachine(
noinline parameters: ParametersDefinition?
) = koinInject<StateMachine<TState, TEvent, TEffect>>(
): StateMachine<TState, TEvent, TEffect> = koinInject<TSM>(
parameters = parameters,
)

0 comments on commit c8d1f32

Please sign in to comment.