redux-utilities/redux-actions

Match updated Observer interface

Open

#30 opened on Sep 17, 2015

View on GitHub
 (4 comments) (0 reactions) (0 assignees)JavaScript (340 forks)batch import
help wanted

Repository metrics

Stars
 (6,540 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

https://github.com/zenparsing/es-observable#observer

interface Observer {

    // Recieves the next value in the sequence
    next(value);

    // Recieves the sequence error
    error(errorValue);

    // Receives the sequence completion value
    complete(completeValue);
}

handleAction() / handleActions() should use the same naming scheme:

const reducer = handleAction(ACITON_TYPE, {
  // Receives normal actions
  next(state, action);

  // Receives `error: true` actions
  error(state, action);

  // Receives `meta.sequence: 'complete'` actions
  complete(state, action);
});

Contributor guide