Skip to content

Improve mapDispatchToProps factory function documentation #872

Closed
@fongandrew

Description

@fongandrew

Some examples were added for factory functions on https://github.com/reactjs/react-redux/blob/master/docs/api.md per #797, but the example for mapDispatchToPropsFactory seems off.

Here's the example:

function mapDispatchToPropsFactory(initialState, initialProps) {
  function goToSomeLink(){
    initialProps.history.push('some/link');
  }
  return function(dispatch){
    return {
      addTodo
    }
  }
}

The function defines goToSomeLink but it's not referenced in any of the return values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions