Invokes action with intent and returns the result.
action
intent
Object? invokeAction(Action action, Intent intent) { return action.invoke(intent); }