Skip to content

Add action as parameter to store.subscribe funcListeners #1697

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

Closed
wants to merge 2 commits into from

Conversation

slashhuang
Copy link

@slashhuang slashhuang commented May 5, 2016

redux is awesome
when in use, I need to add subscribe listeners with action as the parameter. that doesn't really affect redux to be put in use and is only a patchy stuff.

the change is like the following:
listeners[i]() == change to => listeners[i](action)
hope the minor change pull request can be merged

@gaearon
Copy link
Contributor

gaearon commented May 5, 2016

Hi, this has been proposed before. We don’t want to do this because Redux state listeners should depend on the state, not on the action. If you want to have logic specific to the action, middleware is the place to do that.

that doesn't really affect redux to be put in use and is only a patchy stuff.

It’s a core API change, and it would affect Redux apps in a big way. If some API exists, people start to use it, and later we can’t remove it or change it because people depend on it. We don’t want people to depend on this pattern because it is contrary to ideas of Redux.

#347
#580
#622
#1091
#1243
#1300

Sorry I couldn’t be more helpful!

@gaearon gaearon closed this May 5, 2016
@slashhuang
Copy link
Author

thank u ,by the way I really appreciate the design of redux @gaearon

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

Successfully merging this pull request may close these issues.

2 participants