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
The limitation is that there cannot be multiple things trying to handle the same side-effect. The side-effect should always be handled by a single RenderModel consumer.
Using Relay concept
Side effect relay type passed through RenderModel
data classMyFeatureRenderModel(
valscrollSideEffects:SideEffect<ScrollPosition>
)
Potential issues could be a missed side-effect event due to the subscription lifecycle. An effect could happen before the rendering layer is subscribed and can receive it.
The text was updated successfully, but these errors were encountered:
Perhaps you could emulate DispatchWorkSubject (source) and also take in a subscriber count (defaulting to 1) as requirement for emission?
I believe that would fulfill your requirements plus have the ability to queue multiple events while not subscribed.
Edit: I would like to add that DispatchWorkSubject emissions are exclusive to a particular observer. You would need to modify that implementation detail if you wanted a single event to be consumed by more than one observer.
Perhaps you could emulate DispatchWorkSubject (source) and also take in a subscriber count (defaulting to 1) as requirement for emission?
I believe that would fulfill your requirements plus have the ability to queue multiple events while not subscribed.
Edit: I would like to add that DispatchWorkSubject emissions are exclusive to a particular observer. You would need to modify that implementation detail if you wanted a single event to be consumed by more than one observer.
That seems like a good option that is worth exploring. Thanks!
What
Currently, there isn't a well-defined mechanism for passing side-effects to the rendering layer.
Using
SingleLiveEvent
conceptThe limitation is that there cannot be multiple things trying to handle the same side-effect. The side-effect should always be handled by a single
RenderModel
consumer.Using
Relay
conceptSide effect relay type passed through
RenderModel
Rendering layer
Potential issues could be a missed side-effect event due to the subscription lifecycle. An effect could happen before the rendering layer is subscribed and can receive it.
The text was updated successfully, but these errors were encountered: