Open sanbornhilland opened 3 years ago
Are you open to adding a Payload utility type? I think the following would be fairly useful:
Payload
const action = createActionCreator( 'FOO', resolve => (foo: string) => resolve({ foo }), ) // Get the payload type of this action const FooPayload = Payload<typeof action>
Essentially I think you can do something like this but it would be better to make it generic.
type Payload = (ReturnType<typeof action>)['payload']
Sure. If anyone is interested in this, can submit a PR.
Are you open to adding a
Payload
utility type? I think the following would be fairly useful:Essentially I think you can do something like this but it would be better to make it generic.