How does the code behave if action is a string ?
below we call action.user, meaning action HAS TO BE an Action and not a string. Therefore, this line is unnecessary and the doc needs to be updated to [Class] instead of [Class, String].