ActionCreatorWithOptionalPayload(payload?: P): { payload: P; type: T }
Calling this {@link redux#ActionCreator} with an argument will
return a PayloadAction of type T with a payload of P.
Calling it without an argument will return a PayloadAction with a payload of undefined.
Calling this {@link redux#ActionCreator} with an argument will return a PayloadAction of type
T
with a payload ofP
. Calling it without an argument will return a PayloadAction with a payload ofundefined
.