palantir/redoodle

Allow 0 parameters for TypedAction.Definition::create

Closed this issue · 2 comments

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

TypedAction.defineWithoutPayload is designed for exactly this use case.

thanks!