Skip to content

Infer payloads from action creators when creating reducers #580

@sseppola

Description

@sseppola

I commonly see code that explicitly types both the state and action payload when creating a reducer, this is burdensome and can lead to bugs.

eg.

const aReducer = reducer<State, Payload>(customActionCreator, (_, payload) => ({...defaultState, ...payload}))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions