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
Whenever the expression is re-run, the result of previous call to makeNewSource() is stopped, which is the desired behaviour. However, this behaviour becomes buggy when the inner-source is created outside of the expression:
In this case, whenever there is a switch from sourceA to sourceB by the higher-order expression, sourceA is stopped, while it might be depended by other observations and have more data to emit.
This issue is marked as a bug because the current behaviour, though working correctly in most situations, works unexpectedly in some specific situations. To resolve this, I'd suggest the following remedies:
Provide a way to return an inner-source without stopping it on switch. This can be in the form of a select helper function:
Document this specific behaviour and the solution for the case where the inner-source is created outside of the expression.
The suggested solutions require further contemplation and investigation. Initially they seem ok, as although this solution increases the API surface, we do have conflicting use-cases of higher-order sources and the status quo behaviour does match the most common use case, meaning for most use cases the API surface does not get larger and the current level of simplicity is maintained.
The text was updated successfully, but these errors were encountered:
Imagine this scenario:
Whenever the expression is re-run, the result of previous call to
makeNewSource()
is stopped, which is the desired behaviour. However, this behaviour becomes buggy when the inner-source is created outside of the expression:In this case, whenever there is a switch from
sourceA
tosourceB
by the higher-order expression,sourceA
is stopped, while it might be depended by other observations and have more data to emit.This issue is marked as a bug because the current behaviour, though working correctly in most situations, works unexpectedly in some specific situations. To resolve this, I'd suggest the following remedies:
Provide a way to return an inner-source without stopping it on switch. This can be in the form of a
select
helper function:Document this specific behaviour and the solution for the case where the inner-source is created outside of the expression.
The suggested solutions require further contemplation and investigation. Initially they seem ok, as although this solution increases the API surface, we do have conflicting use-cases of higher-order sources and the status quo behaviour does match the most common use case, meaning for most use cases the API surface does not get larger and the current level of simplicity is maintained.
The text was updated successfully, but these errors were encountered: