Skip to content
This repository has been archived by the owner on Mar 6, 2018. It is now read-only.

Observable create pattern for async calls #2

Merged
merged 1 commit into from
Jul 19, 2016
Merged

Observable create pattern for async calls #2

merged 1 commit into from
Jul 19, 2016

Conversation

ivanbruel
Copy link
Contributor

Your code seemed to be over engineered in regards to how observables work.

I refactored it into a Observable.create pattern for async usage.

I only noticed this because when subscribing to the event, it would only trigger once per permission instance, making flatMap usage quite limited.

e.g. usage:

locationButton.rx_tap
      .flatMap {
        return Permission.LocationAlways.rx_permission
      }.subscribeNext { status in
        print(status)
      }.addDisposableTo(rx_disposeBag)

@sunshinejr
Copy link
Owner

Right, wasn't really thinking about asynchronous usage with permissions. Would you be so kind to add description to the property as well, please?

@hernangonzalez
Copy link

@sunshinejr Any chance you can still get this in?

@sunshinejr
Copy link
Owner

@hernangonzalez sure, I'm gonna comment it after the merge 😉

@sunshinejr sunshinejr merged commit 26c5386 into sunshinejr:master Jul 19, 2016
sunshinejr added a commit that referenced this pull request Jul 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants