Removing coupling on tasks slice in store setters
For #185 (closed)
To remove tasks from the store (and use a fetch store instead), we have to deal that some setters in the store (namely setWorkingGraph
and setSubgraph
) are using the tasks in the store (via get().tasks
) to retrieve the list of tasks. There are apparently used to deduce the inputs/outputs of the graph nodes and edges.
Before even thinking about removing, I think this way of accessing tasks
is flawed. Indeed, tasks
are fetched and set when mounting EditPage
. For get().tasks
to return an up-to-date list of tasks, we are relying on the fact that EditPage
is mounted before calling get().tasks
. This is indeed the case but it is an rather indirect coupling.
To solve this, I added tasks
as a parameter to pass to the setters (setWorkingGraph
and setSubgraph
). It is up to the components calling the setters to provide an up-to-date list of tasks.
For now, it is via the existing store slice but later (!335 (merged)) it will be via the fetch store.