Skip to content

Recursive structure for createActions supports identity functions #220

Description

@JasonKid

When using createAction, we can leave the payloadCreator param undefined to make redux-actions use identity function as default.

But in recursive structure of createActions, i set the value undefined, it get's error:

Uncaught Error: Expected function, undefined, or array with payload and meta functions for BASIS/CLOSE_ALERT_BOX

The code is:

import {createActions} from 'redux-actions';

export default createActions({
    BASIS: {
        OPEN_ALERT_BOX: (c) => c,
        CLOSE_ALERT_BOX: undefined,
        OPEN_ERROR_BOX: (c) => c,
        CLOSE_ERROR_BOX: undefined,
    },
});

I think the recursive structure should support undefined value to use identity function for default.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

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