Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MaximPestryakov
Copy link
Contributor

Now, when I want to do something like this:

private class BootstrapperImpl(
    private val dataSource: DataSource,
) : Bootstrapper<Action> {
    override fun invoke(): Observable<Action> =
        dataSource
            .observe()
            .map { Action.NameChanged(it.name) }
            .distinctUntilChanged()
}

I need to explicitly specify .map generic type:

.map<Action> { Action.NameChanged(it.name) }
.distinctUntilChanged()

So, generic Action in Bootstrapper should be covariant (like Actor) to be more flexible in such cases

@MaximPestryakov
Copy link
Contributor Author

@CherryPerry Could you take a look, please?

@CherryPerry
Copy link
Collaborator

Looks good, thanks for your contribution.
I can't say when I can finish with #147 to release new version, but you can always use JitPack build based on commit revision.

@CherryPerry CherryPerry merged commit 137cc77 into badoo:master Sep 25, 2021
@MaximPestryakov MaximPestryakov deleted the bootstrapper_variance branch September 26, 2021 15:01
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.

2 participants