Allow 0 parameters for TypedAction.Definition::create
Closed this issue · 2 comments
shzhng commented
If a define
is called without a generic or with <void>
, the resulting TypedAction.Definition::create
still expects a payload parameter. For example:
const LogoutUserAction = TypedAction.define(UserActionTypes.LOGOUT_USER)();
LogoutUserAction.create();
results in a
error TS2554: Expected 1 arguments, but got 0.
Would be great if we could allow a create
call with no parameters
adidahiya commented
TypedAction.defineWithoutPayload
is designed for exactly this use case.
shzhng commented
thanks!