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
{{ message }}
Repository navigation
Question: Should the data source of the router be an interactor or a presenter? #39
Let's consider a scenario: we've sent the model obtained in the interactor to the presenter to convert it into a presentable format. In the presenter, one element's index within this data was changed. Let's assume that this change is solely related to the presentation layer. (For example, within the "members" array, the presenter identified the current member and moved them to the first position).
After this stage, if the router uses the interactor as its data source, when a user selects an index, they might access the wrong index. In other words, if the user action triggers the router, and what the user clicked is provided by the presenter, shouldn't the router get the data from the presenter to ensure accessing the correct data?
Could either store the presented array in the interactor and have the change reflected there, or could ask the presenter to convert between originalArray index and presentedArray index. I've used both, I suppose it depends on how you want to consider this presentation re-ordering, as a mere presentation thing or as some real re-ordering that could be persisted/uploaded etc.
Activity
catchakos commentedon Sep 12, 2023
Could either store the presented array in the interactor and have the change reflected there, or could ask the presenter to convert between originalArray index and presentedArray index. I've used both, I suppose it depends on how you want to consider this presentation re-ordering, as a mere presentation thing or as some real re-ordering that could be persisted/uploaded etc.