You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-5Lines changed: 11 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,11 +80,17 @@ Each ``Store`` exposes a custom `StoreCallback` though the method `observe` or a
80
80
If you make use of the RxJava methods, you can make use of the `SubscriptionTracker` interface to keep track of the `Disposables` used on your activities and fragments.
81
81
82
82
### Tasks
83
-
A Task is a basic object to represent an ongoing process. They should be used in the state of our `Store` to represent ongoing processes that must be represented in the UI.
83
+
A `Task` is a basic object to represent an ongoing process. They should be used in the state of our `Store` to represent ongoing processes that must be represented in the UI.
84
84
85
+
You can also use `TypedTask` to save metadata related the current task.
86
+
87
+
**IMPORTANT: Do not use TypedTask to hold values that must survive multiple task executions. Save them as a variable in the state instead.**
88
+
89
+
90
+
### Example
85
91
Given the example Stores and Actions explained before, the workflow will be:
86
92
87
-
- View dispatch`LoginAction`.
93
+
- View dispatches`LoginAction`.
88
94
- Store changes his `LoginTask` status to running and call though his SessionController which will do all the async work to log in the given user.
89
95
- View shows an Spinner when `LoginTask` is in running state.
90
96
- The async call ends and `LoginCompleteAction` is dispatched on UI, sending a null `User` and an error state `Task` if the async work failed or a success `Task` and an `User`.
@@ -201,7 +207,7 @@ dependencies {
201
207
You'll need to add the following snippet to your `Application`'s `onCreate` method. If you don't have it, then create it and reference it in your `AndroidManifest.xml` file:
202
208
203
209
```kotlin
204
-
val stores = listOf<Store<*>>(...) // Here you'll set-up you store list, you can retrieve it using your preferred DI framework
210
+
val stores = listOf<Store<*>>() // Here you'll set-up you store list, you can retrieve it using your preferred DI framework
205
211
val dispatcher =MiniGen.newDispatcher() // Create a new dispatcher
206
212
207
213
// Initialize Mini
@@ -211,9 +217,9 @@ stores.forEach { store ->
211
217
}
212
218
213
219
// Optional: add logging interceptor to log action events
0 commit comments