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
It would be nice if we knew what channel triggered the callback.
At the moment if you're subscribed to channels A, B, C for example and the callback is triggered, you can't tell where the changes came from. But there might be times when you might want to ignore changes from A after the initial rendering of the widget. You need A to have data in the beginning, but you don't care about it afterwards.
Some flag on each of the channels indicating whether or not the callback was triggered by them would help a lot.
The text was updated successfully, but these errors were encountered:
Who wants to implement this with a test-case? I propose an extra parameter for the aggregated channels callback, called 'cause', that will be the last one (thus optional).
Here is where we call the callback (and see a few lines above that for the second use-case). It's very simple to add the 'cause', because you have the channel triggering the callback.
Good find, I'm sure I needed this more than once. I'm still wrapping my head around the design pattern implications, but the solution @aismail proposed is quite slick as it doesn't alter any previous code and is easy to implement.
@claudiu-coman you could create the pull request yourself if you want to give it a shot, we're here to help.
It would be nice if we knew what channel triggered the callback.
At the moment if you're subscribed to channels A, B, C for example and the callback is triggered, you can't tell where the changes came from. But there might be times when you might want to ignore changes from A after the initial rendering of the widget. You need A to have data in the beginning, but you don't care about it afterwards.
Some flag on each of the channels indicating whether or not the callback was triggered by them would help a lot.
The text was updated successfully, but these errors were encountered: