Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add DeliverLatest #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add DeliverLatest #134

wants to merge 2 commits into from

Conversation

kanat
Copy link

@kanat kanat commented Jan 14, 2017

Hi.

DeliverLatest completes automatically when the source observable is done.

In my case I have a Repository which emits data from Cache, DB and API. I can emit from Cache first, then from DB and API. It's a sequence of distinct items.

Why I'm not using deliveryLatestCache?

  • to avoid keeping subscription to viewObservable
  • to avoid getting the last cache from observable, cause it can be incorrect (old)

Why I'm not using deliveryFirst?

  • it will emit only first item (from Cache)

Why I'm not using deliveryReplay?

  • the item sequence in ReplaySubject might be outdated and I want just to get the new sequence from Repository (it's already got own cache)

@kanat kanat changed the title New deliver new DeliverLatest Jan 14, 2017
@kanat kanat changed the title new DeliverLatest add DeliverLatest Jan 14, 2017
@konmik
Copy link
Owner

konmik commented Jan 23, 2017

hi, why not just use Observable.last() operator together with deliveryFirst?

@konmik
Copy link
Owner

konmik commented Jan 23, 2017

Oh, I understood why. I need to think a little bit :)

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