-
Notifications
You must be signed in to change notification settings - Fork 151
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
Cleanup public API #120
Comments
Cool, this sounds like a good thing to discuss. I won't have to time consider until the weekend, but others should feel free to chime in 👍 |
@ashfurrow we you agree we can mark this as approved ? |
I like all of these suggestions, especially the deprecation of the existing APIs instead of a replacement. Let's move forward with this, keeping in mind that we still welcome feedback from @RxSwiftCommunity/contributors on these changes 😃 |
+1 for mind-blowing ASCII chart |
BTW the InputSubject strategy was so you have non-terminating inputs. How do you solve this without it ? |
@freak4pc valid point there. Maybe for now we leave that aspect and handle it later on. Because of the |
Hi, there~
Correct me if I'm wrong 👽 PR: Publisher - wrapper for PublishSubject that cannot error |
Sorry, I'm wrong 😔.
|
@bobgodwinx @ashfurrow Deprecating renamed properties makes sense, but let’s keep in mind this cleanup is going to introduce breaking changes anyway. It’s also planned as part of a -sort of LTS- release so may be better to drop them now to avoid any future code churns. My suggestion here will be a Declaration Attribute that;
As for so this dropping of Observability also should eliminates @freak4pc as for non-terminating strategy, IMO the simplest solution is an Thanks all for your valuable feedback, I'd also appreciate your input on |
Thanks for the feedback @mosamer , Some great points here.
I agree with that. It's gonna be a major release probably as far as this codebase goes so I don't think we're risking making some deprecations as long as it doesn't require massive code-changes.
Agreed as well. We wouldn't want people to subscribe to the inputs, but we could just as well make InputSubject fatalError on a non-authorized subscription possibly (since it's our own implementation and not tied to RxSwift core). I'm not sure if a AnyObserver would help solve the non-terminating issue, but it's also a good possibility. |
ok guys let's agree on one thing here. We don't know how people are using |
I know @fpillet is very busy but he's one of the more prominent users of Action (and wrote the chapter on it in the book IIRC), so if he'll have a minute to review this changes I would feel much better with just moving forward with this knowing a "hardcore" user of it feels comfortable making these changes for his use cases. |
I went throw Action's chapter on RxSwift cookbook and did not find anything contradicting these assumption. However, I'd prefer waiting for @fpillet input on the discussion whenever he finds time for it, no rushing. |
Good thinking @mosamer – I did the tech review for the book and I agree nothing about these changes would affect it. But that chapter is an introduction to Action, and I think the changes we're proposing are really things power-users are going to be using, and I want any disruption to their work to be minimized. I would suggest we do the following:
Are there any goals I'm missing? We could also move this to a Google Hangout or Skype call to discuss further. |
Hey guys, sorry to chime in so late. Been held back by insane workloads. Okay so I looked at my usages on
Now a couple things to consider. |
Uhm this makes it a bit hairier to get rid of an Observable-style The "conceptual" problem I have here is that an input isn't something you're supposed to be able to read at all (except for inside the class responsible for handling the inputs, in the case Action itself). I don't have enough time to dive into the PR you mentioned but I'm sure there's a better way to deal with it possibly. Any ways now that there seems to be a plausible use-case for having |
In some case, my Action failed and I want to get invitationSettingAction
.errors
.withLatestFrom(invitationSettingAction.inputs) { $1 }.not()
.subscribeNext { [unowned self] in self.updateInvitationSettingInRealm(status: $0) }
.disposed(by: disposeBag) Actually, we can have another Observable (inputObservable) then bind it to Another approach is exposing an |
@dangthaison91 Thanks for the insight, I will try to have a deeper look on the mentioned PR and the github repo for RxPagination before proceeding. I'm bit busy right now but hopefully will get back to you soon :) |
Hi @dangthaison91, after going through the mentioned PR #37 I can say migrating Of course this migration will come with the following features broken;
let nextPageRequest = Observable
- .combineLatest(action.executing, action.inputs, action.elements) { ($0, $1, $2) }
+ .combineLatest(action.executing, action.elements) { ($0, $1) }
.sample(loadNextPageTrigger)
- .flatMap { loading, lastRequest, lastResponse -> Observable<Request> in
+ .flatMap { loading, lastResponse -> Observable<Void> in
if !loading && lastResponse.hasNextPage {
- return Observable.of(baseRequest.requestWithPage(page: lastRequest.page + 1))
+ return Observable.just(())
} else {
return Observable.empty()
}
}
+ .scan(1) {current, _ in current + 1}
+ .map { baseRequest.requestWithPage(page: $0) }
- let request = action.inputs
+ let request = Observable
.of(refreshRequest, nextPageRequest)
.merge()
+ request
.bind(to: action.inputs)
.disposed(by: disposeBag) IMHO, I believe these features were byproducts and may lead to anti-patterns and we should continue with this approach of replacing subject with observer. |
Currently
Action
might be exposing more properties than needed. Optimally, it should look something likeThus, following changes to be applied;
enabled
, should be renamed toisEnabled
in conformance with Swift API design guidelines.executing
, should be renamed toisExecuting
in conformance with Swift API design guidelines_enabledIf
to be declared asprivate
workFactory
to be declared asprivate
inputs
type to be changed to anObserverType<Input>
.Some questions open for discussion;
executionObservables
remainpublic
?errors
beObservable<ActionError>
orObservable<Swift.Error>
? (may be related to Flatten out underlyingErrors #119 )inputs
beAnyObserver<Input>
orBinder<Input>
?InputSubject
?The text was updated successfully, but these errors were encountered: