Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed Bootstrapper variance #150

Merged
merged 1 commit into from
Sep 25, 2021
Merged

Fixed Bootstrapper variance #150

merged 1 commit into from
Sep 25, 2021

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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants