Skip to content

Commit

Permalink
Deploy motorro/RxLceModel to github.com/motorro/RxLceModel.git:master
Browse files Browse the repository at this point in the history
  • Loading branch information
traviscibot committed Apr 14, 2020
1 parent be1ec04 commit 9479d2e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[com.motorro.rxlcemodel.base](../index.md) / [io.reactivex.Observable](index.md) / [flatMapSingleData](./flat-map-single-data.md)

# flatMapSingleData

`fun <DATA_1 : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, DATA_2 : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA_1`](flat-map-single-data.md#DATA_1)`>>.flatMapSingleData(mapper: (data: `[`DATA_1`](flat-map-single-data.md#DATA_1)`) -> `[`Single`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Single.html)`<`[`DATA_2`](flat-map-single-data.md#DATA_2)`>): `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA_2`](flat-map-single-data.md#DATA_2)`>>`

Maps each [DATA_1](flat-map-single-data.md#DATA_1) to single for [DATA_2](flat-map-single-data.md#DATA_2) and merges back to LceState.
If error occurs in [mapper](flat-map-single-data.md#com.motorro.rxlcemodel.base$flatMapSingleData(io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_1)))), kotlin.Function1((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_1, io.reactivex.Single((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_2)))))/mapper) emits [LceState.Error](../-lce-state/-error/index.md).
Example: load some [DATA_2](flat-map-single-data.md#DATA_2) from server using original [DATA_1](flat-map-single-data.md#DATA_1) as a parameter.

### Parameters

`DATA_1` - Source data type

`DATA_2` - Resulting data type

`mapper` - Data mapper
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| [dataNoErrors](data-no-errors.md) | `val <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](data-no-errors.md#DATA)`>>.dataNoErrors: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`DATA`](data-no-errors.md#DATA)`>`<br>Model's data stream with state information dropped. No error state terminates stream |
| [dataStopOnEmptyErrors](data-stop-on-empty-errors.md) | `val <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](data-stop-on-empty-errors.md#DATA)`>>.dataStopOnEmptyErrors: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`DATA`](data-stop-on-empty-errors.md#DATA)`>`<br>Model's data stream with state information dropped. Will terminate on errors with empty data |
| [dataStopOnErrors](data-stop-on-errors.md) | `val <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](data-stop-on-errors.md#DATA)`>>.dataStopOnErrors: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`DATA`](data-stop-on-errors.md#DATA)`>`<br>Model's data stream with state information dropped. Will terminate on any error |
| [flatMapSingleData](flat-map-single-data.md) | `fun <DATA_1 : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, DATA_2 : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA_1`](flat-map-single-data.md#DATA_1)`>>.flatMapSingleData(mapper: (data: `[`DATA_1`](flat-map-single-data.md#DATA_1)`) -> `[`Single`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Single.html)`<`[`DATA_2`](flat-map-single-data.md#DATA_2)`>): `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA_2`](flat-map-single-data.md#DATA_2)`>>`<br>Maps each [DATA_1](flat-map-single-data.md#DATA_1) to single for [DATA_2](flat-map-single-data.md#DATA_2) and merges back to LceState. If error occurs in [mapper](flat-map-single-data.md#com.motorro.rxlcemodel.base$flatMapSingleData(io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_1)))), kotlin.Function1((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_1, io.reactivex.Single((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_2)))))/mapper) emits [LceState.Error](../-lce-state/-error/index.md). Example: load some [DATA_2](flat-map-single-data.md#DATA_2) from server using original [DATA_1](flat-map-single-data.md#DATA_1) as a parameter. |
| [getData](get-data.md) | `fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](get-data.md#DATA)`>>.getData(terminateOnError: (`[`Error`](../-lce-state/-error/index.md)`<`[`DATA`](get-data.md#DATA)`>) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`): `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`DATA`](get-data.md#DATA)`>`<br>Returns model's data stream dropping state information |
| [onEmptyLoadingReturn](on-empty-loading-return.md) | `fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](on-empty-loading-return.md#DATA)`>>.onEmptyLoadingReturn(block: (`[`Loading`](../-lce-state/-loading/index.md)`<`[`DATA`](on-empty-loading-return.md#DATA)`>) -> `[`LceState`](../-lce-state/index.md)`<`[`DATA`](on-empty-loading-return.md#DATA)`>): `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](on-empty-loading-return.md#DATA)`>>`<br>Substitutes [LceState.Loading](../-lce-state/-loading/index.md) with empty data with state produced by [block](on-empty-loading-return.md#com.motorro.rxlcemodel.base$onEmptyLoadingReturn(io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.onEmptyLoadingReturn.DATA)))), kotlin.Function1((com.motorro.rxlcemodel.base.LceState.Loading((com.motorro.rxlcemodel.base.onEmptyLoadingReturn.DATA)), com.motorro.rxlcemodel.base.LceState(()))))/block) |
| [stopOnEmptyErrors](stop-on-empty-errors.md) | `val <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](stop-on-empty-errors.md#DATA)`>>.stopOnEmptyErrors: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](stop-on-empty-errors.md#DATA)`>>`<br>Model's state stream which terminates on errors with empty data |
Expand Down
1 change: 1 addition & 0 deletions docs/package-list
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ $dokka.linkExtension:md
$dokka.location:com.motorro.rxlcemodel.base$dataNoErrors#io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.dataNoErrors.DATA))))com.motorro.rxlcemodel.base/io.reactivex.-observable/data-no-errors.md
$dokka.location:com.motorro.rxlcemodel.base$dataStopOnEmptyErrors#io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.dataStopOnEmptyErrors.DATA))))com.motorro.rxlcemodel.base/io.reactivex.-observable/data-stop-on-empty-errors.md
$dokka.location:com.motorro.rxlcemodel.base$dataStopOnErrors#io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.dataStopOnErrors.DATA))))com.motorro.rxlcemodel.base/io.reactivex.-observable/data-stop-on-errors.md
$dokka.location:com.motorro.rxlcemodel.base$flatMapSingleData(io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_1)))), kotlin.Function1((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_1, io.reactivex.Single((com.motorro.rxlcemodel.base.flatMapSingleData.DATA_2)))))com.motorro.rxlcemodel.base/io.reactivex.-observable/flat-map-single-data.md
$dokka.location:com.motorro.rxlcemodel.base$getData(io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.getData.DATA)))), kotlin.Function1((com.motorro.rxlcemodel.base.LceState.Error((com.motorro.rxlcemodel.base.getData.DATA)), kotlin.Boolean)))com.motorro.rxlcemodel.base/io.reactivex.-observable/get-data.md
$dokka.location:com.motorro.rxlcemodel.base$onEmptyLoadingReturn(io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.onEmptyLoadingReturn.DATA)))), kotlin.Function1((com.motorro.rxlcemodel.base.LceState.Loading((com.motorro.rxlcemodel.base.onEmptyLoadingReturn.DATA)), com.motorro.rxlcemodel.base.LceState(()))))com.motorro.rxlcemodel.base/io.reactivex.-observable/on-empty-loading-return.md
$dokka.location:com.motorro.rxlcemodel.base$stopOnEmptyErrors#io.reactivex.Observable((com.motorro.rxlcemodel.base.LceState((com.motorro.rxlcemodel.base.stopOnEmptyErrors.DATA))))com.motorro.rxlcemodel.base/io.reactivex.-observable/stop-on-empty-errors.md
Expand Down

0 comments on commit 9479d2e

Please sign in to comment.