Skip to content

turn actions arguments into a payload and remove callback #5

@tarmann

Description

@tarmann

Quite often we have to send more than one param to the actions and this can get quite messy.

Also, we are not using the callback as we intended in the beginning.

So instead of:

  doSomethingTask: task(function * (store, callback, model, param1, param2){
    updatedModel = yield doSomething(model, param1, param2);
    return { callback, model: updatedModel };
  })

We can have:

  doSomethingTask: task(function * (store, payload){
    response = yield doSomething(model, payload[0], payload[1], payload[2]);
    return response;
  })

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