File tree Expand file tree Collapse file tree 3 files changed +1
-26
lines changed
src/commonMain/kotlin/com/example/common
iOS/KmpStarterSwiftUi/KmpStarterSwiftUi Expand file tree Collapse file tree 3 files changed +1
-26
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,6 @@ kotlin {
2222 }
2323 compilations. main. extraOpts " -Xobjc-generics"
2424 }
25-
26- // fromPreset(presets.iosArm64, 'ios') {
27- // binaries {
28- // framework('common')
29- // }
30- // }
31-
3225 }
3326 sourceSets {
3427 commonMain {
Original file line number Diff line number Diff line change 11package com.example.common
22
3- import org.reduxkotlin.Reducer
4- import org.reduxkotlin.createStore
53
64val helloWordText = " Hello Kotlin MP"
75
8- data class AppState (val count : Int = 0 )
96
10- class ButtonTap
11-
12- val reducer: Reducer <AppState > = {state, action ->
13- when (action) {
14- is ButtonTap -> state.copy(count = state.count + 1 )
15- else -> state
16- }
17- }
18-
19- val store = createStore(reducer, AppState ())
20-
21- data class MainViewState (val counterText : String )
22-
23- fun AppState.toMainViewState () = MainViewState (count.toString())
247
258
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ import common
1111
1212struct ContentView : View {
1313 var body : some View {
14- let txt = KmpStarterAppKt . store. state!. toMainViewState ( ) . counterText
15- return Text ( txt)
14+ return Text ( KmpStarterAppKt . helloWordText)
1615 }
1716}
1817
You can’t perform that action at this time.
0 commit comments