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 Jan 4, 2020
1 parent 2d40c46 commit 1cd85e0
Show file tree
Hide file tree
Showing 41 changed files with 101 additions and 169 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# <init>

`CacheThenNetLceModel(params: `[`PARAMS`](index.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>>)`
`CacheThenNetLceModel(params: `[`PARAMS`](index.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`>>)`

A [LceModel](../-lce-model/index.md) which uses cache subscription as a 'source of truth'.
When [state](state.md) is subscribed it loads cache data refreshing it if cache is stall or whenever cache
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ Cache service *must* notify of its data changes!

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `CacheThenNetLceModel(params: `[`PARAMS`](index.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>>)`<br>A [LceModel](../-lce-model/index.md) which uses cache subscription as a 'source of truth'. When [state](state.md) is subscribed it loads cache data refreshing it if cache is stall or whenever cache returns [com.gojuno.koptional.None](#). The model always returns cached data first - then network if data is stall Cache service *must* notify of its data changes! |
| [&lt;init&gt;](-init-.md) | `CacheThenNetLceModel(params: `[`PARAMS`](index.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`>>)`<br>A [LceModel](../-lce-model/index.md) which uses cache subscription as a 'source of truth'. When [state](state.md) is subscribed it loads cache data refreshing it if cache is stall or whenever cache returns [com.gojuno.koptional.None](#). The model always returns cached data first - then network if data is stall Cache service *must* notify of its data changes! |

### Properties

| Name | Summary |
|---|---|
| [params](params.md) | `val params: `[`PARAMS`](index.md#PARAMS)<br>Params that identify data being loaded |
| [refresh](refresh.md) | `val refresh: `[`Completable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Completable.html)<br>Requests a refresh of data. Data will be updated asynchronously |
| [state](state.md) | `val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>>`<br>Model data. Subscription starts data load for the first subscriber. Whenever last subscriber cancels, the model unsubscribes internal components for data updates |
| [state](state.md) | `val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`>>`<br>Model data. Subscription starts data load for the first subscriber. Whenever last subscriber cancels, the model unsubscribes internal components for data updates |

### Extension Functions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# state

`val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>>`
`val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`>>`

Overrides [LceModel.state](../-lce-model/state.md)

Expand Down
4 changes: 2 additions & 2 deletions docs/com.motorro.rxlcemodel.base/-lce-model/cache-then-net.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# cacheThenNet

`@JvmOverloads fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>> = Observable.just(Loading(null, false, params))): `[`LceModel`](index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`
`@JvmOverloads fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`>> = Observable.just(Loading(null, false))): `[`LceModel`](index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`

Creates a model that returns cached data first, then refreshes if stall

Expand All @@ -16,7 +16,7 @@ Creates a model that returns cached data first, then refreshes if stall

`serviceSet` - Service-set to load data

`startWith` - Observable that emits at loading start. Defaults to [LceState.Loading](../-lce-state/-loading/index.md)`@JvmOverloads fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, net: `[`NetService`](../../com.motorro.rxlcemodel.base.service/-net-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, cache: `[`CacheService`](../../com.motorro.rxlcemodel.base.service/-cache-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>> = Observable.just(Loading(null, false, params))): `[`LceModel`](index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`
`startWith` - Observable that emits at loading start. Defaults to [LceState.Loading](../-lce-state/-loading/index.md)`@JvmOverloads fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, net: `[`NetService`](../../com.motorro.rxlcemodel.base.service/-net-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, cache: `[`CacheService`](../../com.motorro.rxlcemodel.base.service/-cache-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`>> = Observable.just(Loading(null, false))): `[`LceModel`](index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`

Creates a model that returns cached data first, than refreshes if stall

Expand Down
4 changes: 2 additions & 2 deletions docs/com.motorro.rxlcemodel.base/-lce-model/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ A model interface to load data and transmit it to subscribers along with loading
|---|---|
| [params](params.md) | `abstract val params: `[`PARAMS`](index.md#PARAMS)<br>Params that identify data being loaded |
| [refresh](refresh.md) | `abstract val refresh: `[`Completable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Completable.html)<br>Requests a refresh of data. Data will be updated asynchronously |
| [state](state.md) | `abstract val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>>`<br>Model state. Subscription starts data load for the first subscriber. Whenever last subscriber cancels, the model unsubscribes internal components for data updates |
| [state](state.md) | `abstract val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`>>`<br>Model state. Subscription starts data load for the first subscriber. Whenever last subscriber cancels, the model unsubscribes internal components for data updates |

### Companion Object Functions

| Name | Summary |
|---|---|
| [cacheThenNet](cache-then-net.md) | `fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>> = Observable.just(Loading(null, false, params))): `[`LceModel`](./index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`<br>Creates a model that returns cached data first, then refreshes if stall`fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, net: `[`NetService`](../../com.motorro.rxlcemodel.base.service/-net-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, cache: `[`CacheService`](../../com.motorro.rxlcemodel.base.service/-cache-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>> = Observable.just(Loading(null, false, params))): `[`LceModel`](./index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`<br>Creates a model that returns cached data first, than refreshes if stall |
| [cacheThenNet](cache-then-net.md) | `fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, serviceSet: `[`ServiceSet`](../../com.motorro.rxlcemodel.base.service/-service-set/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`>> = Observable.just(Loading(null, false))): `[`LceModel`](./index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`<br>Creates a model that returns cached data first, then refreshes if stall`fun <DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> cacheThenNet(params: `[`PARAMS`](cache-then-net.md#PARAMS)`, net: `[`NetService`](../../com.motorro.rxlcemodel.base.service/-net-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, cache: `[`CacheService`](../../com.motorro.rxlcemodel.base.service/-cache-service/index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>, startWith: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](cache-then-net.md#DATA)`>> = Observable.just(Loading(null, false))): `[`LceModel`](./index.md)`<`[`DATA`](cache-then-net.md#DATA)`, `[`PARAMS`](cache-then-net.md#PARAMS)`>`<br>Creates a model that returns cached data first, than refreshes if stall |

### Extension Functions

Expand Down
2 changes: 1 addition & 1 deletion docs/com.motorro.rxlcemodel.base/-lce-model/state.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# state

`abstract val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>>`
`abstract val state: `[`Observable`](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html)`<`[`LceState`](../-lce-state/index.md)`<`[`DATA`](index.md#DATA)`>>`

Model state. Subscription starts data load for the first subscriber.
Whenever last subscriber cancels, the model unsubscribes internal components for data updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# &lt;init&gt;

`Content(data: `[`DATA`](index.md#DATA)`, dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, params: `[`PARAMS`](index.md#PARAMS)`)`
`Content(data: `[`DATA`](index.md#DATA)`, dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)`

Data is loaded and content is displayed

9 changes: 4 additions & 5 deletions docs/com.motorro.rxlcemodel.base/-lce-state/-content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@

# Content

`data class Content<out DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`, PARAMS : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> : `[`LceState`](../index.md)`<`[`DATA`](index.md#DATA)`, `[`PARAMS`](index.md#PARAMS)`>`
`data class Content<out DATA : `[`Any`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)`> : `[`LceState`](../index.md)`<`[`DATA`](index.md#DATA)`>`

Data is loaded and content is displayed

### Constructors

| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `Content(data: `[`DATA`](index.md#DATA)`, dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, params: `[`PARAMS`](index.md#PARAMS)`)`<br>Data is loaded and content is displayed |
| [&lt;init&gt;](-init-.md) | `Content(data: `[`DATA`](index.md#DATA)`, dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)`<br>Data is loaded and content is displayed |

### Properties

| Name | Summary |
|---|---|
| [data](data.md) | `val data: `[`DATA`](index.md#DATA)<br>State data |
| [dataIsValid](data-is-valid.md) | `val dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Data validity at the time of emission |
| [params](params.md) | `val params: `[`PARAMS`](index.md#PARAMS)<br>Params used to load [data](data.md) |

### Inherited Functions

| Name | Summary |
|---|---|
| [toError](../to-error.md) | `fun toError(error: `[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`): `[`Error`](../-error/index.md)`<`[`DATA`](../index.md#DATA)`, `[`PARAMS`](../index.md#PARAMS)`>`<br>Transfers to [Error](../-error/index.md) state preserving data |
| [toLoading](../to-loading.md) | `fun toLoading(type: `[`Type`](../-loading/-type/index.md)` = Loading.Type.LOADING): `[`Loading`](../-loading/index.md)`<`[`DATA`](../index.md#DATA)`, `[`PARAMS`](../index.md#PARAMS)`>`<br>Transfers to [Loading](../-loading/index.md) state preserving data |
| [toError](../to-error.md) | `fun toError(error: `[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`): `[`Error`](../-error/index.md)`<`[`DATA`](../index.md#DATA)`>`<br>Transfers to [Error](../-error/index.md) state preserving data |
| [toLoading](../to-loading.md) | `fun toLoading(type: `[`Type`](../-loading/-type/index.md)` = Loading.Type.LOADING): `[`Loading`](../-loading/index.md)`<`[`DATA`](../index.md#DATA)`>`<br>Transfers to [Loading](../-loading/index.md) state preserving data |
13 changes: 0 additions & 13 deletions docs/com.motorro.rxlcemodel.base/-lce-state/-content/params.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# &lt;init&gt;

`Error(data: `[`DATA`](index.md#DATA)`?, dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, params: `[`PARAMS`](index.md#PARAMS)`, error: `[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`)`
`Error(data: `[`DATA`](index.md#DATA)`?, dataIsValid: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`, error: `[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`)`

Data (or part of it) failed to load

Loading

0 comments on commit 1cd85e0

Please sign in to comment.