Skip to content

Conversation

@nanoxd
Copy link
Collaborator

@nanoxd nanoxd commented Dec 31, 2015

  • just -> Observable.just
  • Variable is no longer a direct ObservableType
    • Didn't affect us as we were already bridging it to an Observable.
  • empty() -> Observable.empty
  • MainScheduler.sharedInstance -> MainScheduler.instance
  • create -> Observable.create
  • combineLatest -> Observable.combineLatest
    Refs Update to RxSwift RC #18

@ashfurrow
Copy link
Member

Cool! FYI Swift's type inference is pretty powerful, so you can write things like .empty() instead of Obervable.empty() which makes things shorter.

@nanoxd
Copy link
Collaborator Author

nanoxd commented Dec 31, 2015

Thanks, I forgot all about that.

edit: Looks like it doesn't like it outside of return statements. Swift ignores whitespace to tack on a method call on an object.

let thing1 = Observable.just(1)

.delaySubscription(2.0, scheduler: SplatoonScheduler.instance)

@nanoxd nanoxd changed the title [WIP] Update to RxSwift RC [WIP] Update to RxSwift 2.0 Jan 4, 2016
@nanoxd
Copy link
Collaborator Author

nanoxd commented Jan 4, 2016

Updated to 2.0.0 proper. I'm having some issues resolving the error though 😕, The test failure is on AlertAction disabling the button when enabledIf is set to Observable.just(false). I've stepped debugger and couldn't fine anything immediately apparent to cause the error.

Things I checked:

  • UIAlertAction's rx_enabled still matches RxSwift's
  • Using a custom CocoaAction with enabledIf set to false
  • Adding .debug on _enabledIf to verify a .Next event of false occurred.
  • Checked for changes in RxSwift that could cause the issue.

Any help would be greatly appreciated 😄

@ashfurrow
Copy link
Member

Cool, taking a look now 👍

@ashfurrow
Copy link
Member

So the failure is happening intermittently; if you run only the failing test, it works. Looking into this more now...

@ashfurrow
Copy link
Member

Using toEventually fixes the problem, but I'm still not sure of the cause and that makes me uncomfortable.

@nanoxd
Copy link
Collaborator Author

nanoxd commented Jan 4, 2016

So the failure is happening intermittently; if you run only the failing test, it works.

I experienced that as well but worried it was an issue further down the chain.

@ashfurrow
Copy link
Member

Cool, so I added a check that makes it clear that the test waits for an enabled change before continuing. I think this is acceptable – would like feedback.

Everything else looks 👌 I'd just like the Observable.just to replaced with .just (same with empty etc) as we discussed earlier. Then we can merge 🎉

Thanks again for your work!

@nanoxd
Copy link
Collaborator Author

nanoxd commented Jan 4, 2016

I don't see any immediate issues with the enabled check!

Thanks for looking into it, I'll make those changes shortly.

@nanoxd
Copy link
Collaborator Author

nanoxd commented Jan 4, 2016

Shortened static functions to .{just,empty,create} wherever possible. .creates were especially susceptible to "Type of expression is ambiguous without more context" errors 😦

@ashfurrow
Copy link
Member

Fab 🎉

ashfurrow added a commit that referenced this pull request Jan 4, 2016
@ashfurrow ashfurrow merged commit 7337194 into master Jan 4, 2016
@ashfurrow ashfurrow deleted the rxswift-rc branch January 4, 2016 16:32
@nanoxd
Copy link
Collaborator Author

nanoxd commented Jan 4, 2016

@nanoxd nanoxd mentioned this pull request Jan 4, 2016
6 tasks
@nanoxd nanoxd changed the title [WIP] Update to RxSwift 2.0 Update to RxSwift 2.0 Jan 4, 2016
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