Skip to content

ArgumentType? #26196

@mmahalwy

Description

@mmahalwy

Similar to how TS has ReturnType, is it possible to have ArgumentType? Or an example of how to extract a function's arguments and specify a different return type?

Example, due to redux-pack changing this action to a promise

export function createMyPackActionWithArgs(arg1: string, arg2?: string) {
  return { type: MY_PACK_ACTION, promise: fetchMyData() };
}

This technically returns a Promise when in component but an Object when reducer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions