Skip to content

Commit e5388c8

Browse files
tasomaniacelihart
authored andcommitted
Small fixes on comments (airbnb#263)
1 parent 876fe0f commit e5388c8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

mvrx/src/main/kotlin/com/airbnb/mvrx/BaseMvRxViewModel.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ abstract class BaseMvRxViewModel<S : MvRxState>(
136136

137137
/**
138138
* 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.
140140
*/
141141
protected fun withState(block: (state: S) -> Unit) {
142142
stateStore.get(block)
@@ -156,15 +156,15 @@ abstract class BaseMvRxViewModel<S : MvRxState>(
156156
}
157157

158158
/**
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.
160160
*/
161161
fun <T> Single<T>.execute(
162162
stateReducer: S.(Async<T>) -> S
163163
) = toObservable().execute({ it }, null, stateReducer)
164164

165165
/**
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.
168168
* @param stateReducer A reducer that is applied to the current state and should return the
169169
* new state. Because the state is the receiver and it likely a data
170170
* class, an implementation may look like: `{ copy(response = it) }`.
@@ -175,23 +175,23 @@ abstract class BaseMvRxViewModel<S : MvRxState>(
175175
) = toObservable().execute(mapper, null, stateReducer)
176176

177177
/**
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.
179179
*/
180180
fun <T> Observable<T>.execute(
181181
stateReducer: S.(Async<T>) -> S
182182
) = execute({ it }, null, stateReducer)
183183

184184
/**
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.
186186
*/
187187
fun Completable.execute(
188188
stateReducer: S.(Async<Unit>) -> S
189189
) = toSingle { Unit }.execute(stateReducer)
190190

191191
/**
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.
193193
*
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.
195195
* @param successMetaData A map that provides metadata to set on the Success result.
196196
* It allows data about the original Observable to be kept and accessed later. For example,
197197
* your mapper could map a network request to just the data your UI needs, but your base layers could

0 commit comments

Comments
 (0)