You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is something I think might be an inherent design flaw in AutoDispose currently. Maybe was used before under the idea that scopes could potentially not emit. However, it's left us in an awkward case where they could either emit or complete, which is different. Furthermore, it's actually not dangerous to depend on a single because in the event of termination of the source stream, it would just dispose the single it was waiting on.
This is a pretty significant API change. Fortunately I think it would be mitigated by the fact that most people use ScopeProvider and LifecycleScopeProvider + hopefully the test helpers.
The text was updated successfully, but these errors were encountered:
Devil's advocate: Scopes externally often do get represented as Maybe because they might not actually "end" per se. Consider a scope that is represented by a DB transaction, where you might want to show a loading indicator until some other stream emits. That stream might be represented by a Maybe as a database, and the flexibility to allow for it is helpful here. firstElement() also feels softer than coercing things via firstOrError().
Alternatively - we could make it not a breaking change by adding more overloads for with() now, which is a lot simpler to maintain than it used to be. We can still just change implementation details to narrow down to a Single instead. I'm leaning toward this
This is something I think might be an inherent design flaw in AutoDispose currently. Maybe was used before under the idea that scopes could potentially not emit. However, it's left us in an awkward case where they could either emit or complete, which is different. Furthermore, it's actually not dangerous to depend on a single because in the event of termination of the source stream, it would just dispose the single it was waiting on.
This is a pretty significant API change. Fortunately I think it would be mitigated by the fact that most people use
ScopeProvider
andLifecycleScopeProvider
+ hopefully the test helpers.The text was updated successfully, but these errors were encountered: