Skip to content

Conversation

@dmdevgo
Copy link
Owner

@dmdevgo dmdevgo commented Oct 3, 2019

In many cases, the state is a simple consumer of storage or another state. In this case, it is convenient to have an extension function that takes a data source and subscribes to it. This saves us from boilerplate code and makes the code more declarative:

val items = stateOf(repositoryObservable)

A similar problem exists when describing an action. You must subscribe to it and correctly resubscribe when you receive an error. The following code describes an action chain:

val buttonClicks = action<Unit> {
    this.filter { }
        .doOnNext { } 
}

@dmdevgo dmdevgo requested a review from Jeevuz October 3, 2019 00:17
@dmdevgo dmdevgo marked this pull request as ready for review October 24, 2019 21:51
@Jeevuz
Copy link
Collaborator

Jeevuz commented Oct 26, 2019

@dmdevgo Now you check and merge ;)

@dmdevgo dmdevgo merged commit f8dc78c into develop Oct 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants