Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve mapDispatchToProps factory function documentation #872

Closed
fongandrew opened this issue Feb 9, 2018 · 2 comments
Closed

Improve mapDispatchToProps factory function documentation #872

fongandrew opened this issue Feb 9, 2018 · 2 comments

Comments

@fongandrew
Copy link

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.

@fongandrew
Copy link
Author

@markerikson

@timdorr
Copy link
Member

timdorr commented Feb 9, 2018

Yeah, wait...wut. I guess I merged that too soon. I'm not a factory user, so my eyes tend to glaze over at these things. Whoops!

@timdorr timdorr closed this as completed Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants