Skip to content

callAction has a bad condition | bug #444

Open
@seeden

Description

@seeden

Hi

I found a very strange behaviour. My done callback was very often called twice. The problem is on the next line

} else if (action.length < 3) {

I am using babel and babel will transform next action

export function setAction(context, payload = {}, done) {
}

into the

function setAction(context) {
  var payload = arguments[1] || {};
  var done = arguments[2];
}

As you can see transformed action named setAction has just one parameter (original has 3 parameters) and your condition action.length < 3 will be equals true. I think that too many of us are using babel in this moment and can have a same problem.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions