Skip to content

Commit

Permalink
[feat] #4 orbit util
Browse files Browse the repository at this point in the history
  • Loading branch information
Sangwook123 committed Apr 13, 2024
1 parent 76cba18 commit bbf8b7e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@ dependencies {
implementation(libs.bundles.androidx.lifecycle)
implementation(libs.bundles.coroutine)
implementation(libs.bundles.androidx.navigation)
implementation(libs.bundles.orbit)
}
11 changes: 11 additions & 0 deletions core/ui/src/main/java/org/sopt/ui/orbit/OrbitUtil.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.sopt.ui.orbit

import org.orbitmvi.orbit.ContainerHost
import org.orbitmvi.orbit.syntax.simple.intent
import org.orbitmvi.orbit.syntax.simple.reduce

fun <STATE : Any, SIDE_EFFECT : Any> ContainerHost<STATE, SIDE_EFFECT>.updateState(
reducer: STATE.() -> STATE
) = intent {
reduce { state.reducer() }
}

0 comments on commit bbf8b7e

Please sign in to comment.