Skip to content

Commit

Permalink
7.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
evert committed Sep 4, 2022
1 parent 7eb0b62 commit 2b01de4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/state/base-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export class BaseState<T> extends BaseHeadState implements State<T> {
* If no name is given, the first action is returned. This is useful for
* formats that only supply 1 action, and no name.
*/
action<TFormData = any>(name?: string): Action<TFormData> {
action<TFormData extends Record<string, any> = any>(name?: string): Action<TFormData> {

if (!this.actionInfo.length) {
throw new ActionNotFound('This State does not define any actions');
Expand Down
2 changes: 1 addition & 1 deletion src/state/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type State<T = any> = {
*
* If the format provides a default action, the name may be omitted.
*/
action<TFormData = any>(name?: string): Action<TFormData>;
action<TFormData extends Record<string, any> = any>(name?: string): Action<TFormData>;

/**
* Returns all actions
Expand Down

0 comments on commit 2b01de4

Please sign in to comment.