I have a fetchStatusesAction that triggers an API request. The action has [String]? as its input, which is either nil to fetch all, or an array of string IDs to fetch a subset of the data.
I'm trying to use the action's executing producer so I can display a loading state for each of the individual status cells. When all statuses are fetched, every cell should show a spinner. When just 1 status is fetched (via fetchStatusesAction.apply(["some-id"]).start()), only its cell should show the spinner.
I _think_ what i'm struggling with is that, when the action is executing, there is no way to find out what input it started with and therefore no way to filter the "loading" signal to just the relevant cell.
Is this possible?
Instead of passing a [String]? use something like this:
enum Statuses {
case All
case SubSet([String])
}
You shouldn't rely on nullability to represent your intentions. Make the most of Swift's features! 馃
Most helpful comment
Instead of passing a
[String]?use something like this:You shouldn't rely on nullability to represent your intentions. Make the most of Swift's features! 馃