File tree Expand file tree Collapse file tree 3 files changed +11
-25
lines changed
app/src/main/java/org/sample
mini-processor/src/main/java/mini/processor Expand file tree Collapse file tree 3 files changed +11
-25
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,10 @@ import com.mini.android.FluxActivity
5
5
import com.minikorp.grove.ConsoleLogTree
6
6
import com.minikorp.grove.Grove
7
7
import kotlinx.android.synthetic.main.home_activity.*
8
- import mini.*
8
+ import mini.Action
9
+ import mini.LoggerInterceptor
10
+ import mini.MiniGen
11
+ import mini.Store
9
12
10
13
class SampleActivity : FluxActivity () {
11
14
@@ -29,32 +32,17 @@ class SampleActivity : FluxActivity() {
29
32
Grove .tag(tag).d { msg }
30
33
}))
31
34
32
- dispatcher.dispatch(ActionOne (" " ))
33
35
dispatcher.dispatch(ActionTwo (" 2" ))
34
36
}
35
37
}
36
38
39
+ @Action
37
40
interface ActionInterface {
38
41
val text: String
39
42
}
40
43
41
- abstract class SampleAbstractAction : BaseAction ()
42
-
43
- data class ActionOne (override val text : String ) : ActionInterface, SampleAbstractAction()
44
-
45
- @Action class ActionTwo (val text : String )
44
+ @Action
45
+ class ActionTwo (override val text : String ) : ActionInterface
46
46
47
47
data class DummyState (val text : String = " dummy" )
48
- class DummyStore : Store <DummyState >() {
49
-
50
- @Reducer fun onInterfaceAction (a : ActionInterface ) {
51
- }
52
-
53
- @Reducer fun onSampleAction (a : ActionOne ) {
54
- newState = state.copy(text = a.text)
55
- }
56
-
57
- @Reducer fun anotherAction (a : ActionTwo ) {
58
- state.copy(text = a.text).asNewState()
59
- }
60
- }
48
+ class DummyStore : Store <DummyState >()
Original file line number Diff line number Diff line change 1
1
buildscript {
2
2
ext {
3
3
kotlin_version = " 1.3.41"
4
- mini_version = " 4.0.3 "
4
+ mini_version = " 4.0.4 "
5
5
}
6
6
7
7
repositories {
Original file line number Diff line number Diff line change 1
1
package mini.processor
2
2
3
- import com.squareup.kotlinpoet.CodeBlock
4
- import com.squareup.kotlinpoet.FunSpec
3
+ import com.squareup.kotlinpoet.*
5
4
import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy
6
- import com.squareup.kotlinpoet.TypeSpec
7
- import com.squareup.kotlinpoet.asTypeName
8
5
import mini.CompositeCloseable
9
6
import mini.Dispatcher
10
7
import mini.Reducer
@@ -44,6 +41,7 @@ object ReducersGenerator {
44
41
.build()
45
42
46
43
val registerOneFn = FunSpec .builder(" subscribe" )
44
+ .addModifiers(KModifier .PRIVATE )
47
45
.addParameter(" dispatcher" , Dispatcher ::class )
48
46
.addParameter(" container" , reducerContainerType)
49
47
.returns(Closeable ::class )
You can’t perform that action at this time.
0 commit comments