As of today, the only way to retrieve an action by name is via the following pattern:
if (state.hasAction('delete')) {
state.action('delete').submit({});
}
The guard is needed because State#action(string) will throw if there is no action for this name.
Could we provide a method similar to State#action(string) that would return undefined if the action is not found?
That would allow the following pattern:
state.action('delete')?.submit({});