Skip to content
This repository was archived by the owner on Feb 3, 2020. It is now read-only.
This repository was archived by the owner on Feb 3, 2020. It is now read-only.

using createAction without type parameters is unsafe #28

Open
@mixvar

Description

@mixvar

currently:

 // action payload type is '{}' which is almost as bad as any
const anyAction = createAction('increment');

I think it would be safer to default to void or somehow force user to specifying type parameter and be explicit about using any:

const voidAction = createAction('increment'); // same as using <void>

// or
const illegalAction = createAction('increment'); //compile error

// still possible but explicit
const anyAction = createAction<any>('increment');

Tested with typescript 3.4.5 and all strict rules enabled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions