@@ -136,7 +136,7 @@ abstract class BaseMvRxViewModel<S : MvRxState>(
136
136
137
137
/* *
138
138
* Access the current ViewModel state. Takes a block of code that will be run after all current pending state
139
- * updates are processed. The `this` inside of the block is the state.
139
+ * updates are processed.
140
140
*/
141
141
protected fun withState (block : (state: S ) -> Unit ) {
142
142
stateStore.get(block)
@@ -156,15 +156,15 @@ abstract class BaseMvRxViewModel<S : MvRxState>(
156
156
}
157
157
158
158
/* *
159
- * Helper to map an Single to an Async property on the state object.
159
+ * Helper to map a [ Single] to an [ Async] property on the state object.
160
160
*/
161
161
fun <T > Single<T>.execute (
162
162
stateReducer : S .(Async <T >) -> S
163
163
) = toObservable().execute({ it }, null , stateReducer)
164
164
165
165
/* *
166
- * Helper to map an Single to an Async property on the state object.
167
- * @param mapper A map converting the observable type to the desired AsyncData type.
166
+ * Helper to map a [ Single] to an [ Async] property on the state object.
167
+ * @param mapper A map converting the Single type to the desired Async type.
168
168
* @param stateReducer A reducer that is applied to the current state and should return the
169
169
* new state. Because the state is the receiver and it likely a data
170
170
* class, an implementation may look like: `{ copy(response = it) }`.
@@ -175,23 +175,23 @@ abstract class BaseMvRxViewModel<S : MvRxState>(
175
175
) = toObservable().execute(mapper, null , stateReducer)
176
176
177
177
/* *
178
- * Helper to map an observable to an Async property on the state object.
178
+ * Helper to map an [Observable] to an [ Async] property on the state object.
179
179
*/
180
180
fun <T > Observable<T>.execute (
181
181
stateReducer : S .(Async <T >) -> S
182
182
) = execute({ it }, null , stateReducer)
183
183
184
184
/* *
185
- * Helper to map a Completable to an Async property on the state object.
185
+ * Helper to map a [ Completable] to an [ Async] property on the state object.
186
186
*/
187
187
fun Completable.execute (
188
188
stateReducer : S .(Async <Unit >) -> S
189
189
) = toSingle { Unit }.execute(stateReducer)
190
190
191
191
/* *
192
- * Execute an observable and wrap its progression with AsyncData reduced to the global state.
192
+ * Execute an [Observable] and wrap its progression with [Async] property reduced to the global state.
193
193
*
194
- * @param mapper A map converting the observable type to the desired AsyncData type.
194
+ * @param mapper A map converting the Observable type to the desired Async type.
195
195
* @param successMetaData A map that provides metadata to set on the Success result.
196
196
* It allows data about the original Observable to be kept and accessed later. For example,
197
197
* your mapper could map a network request to just the data your UI needs, but your base layers could
0 commit comments