-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
RxCommandStream inputObservable not closed on dispose #28
Comments
Good catch, I really wished we had destructors. |
Well, we create commands for every manager/BLoC and as you move through the app from screen to screen some managers get disposed and rebuild. |
Could you live with a dispose method on commands? |
The commands have a
Regarding manager lifecycle, I can see some managers being global but how would you go about using commands for some list view where each child needs some load command and display its individual |
Sorry that I didn't have time yet. |
We don't need Viewmodels behind our widgets |
But then they would have to fetch their data sequentially as one command can only track executing state for one ID parameter. |
Hi, |
@kuhnroyal Interested in a short chat on this topic? |
I had now a closer look, sorry for the delay. var inputObservable = Observable(_observableProvider(param))
.handleError((error) {
thrownException = error;
})
.doOnData((result) => _resultsSubject.add(result))
.map((result) {
lastResult = result;
return CommandResult(result, null, true);
});
_commandResultsSubject.addStream(inputObservable).then((_) {
if (thrownException != null) {
if (throwExceptions) {
_resultsSubject.addError(thrownException); You cannot close an observable, you only can close a StreamController or cancel a subscription. I also changed the sequence of the dispose method. |
Fixed in V4.3.3 |
The input observable for
RxCommandStream
here is not closed when the command is disposed.I am wondering if this should be handled by the RxCommand itself or if I should manually add some
takeUntil
logic, which seems like lots of boilerplate.The text was updated successfully, but these errors were encountered: