Skip to content

Redux Doc's Advanced Middleware Section Wrong Order #2612

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
icharlie2 opened this issue Sep 15, 2017 · 1 comment
Closed

Redux Doc's Advanced Middleware Section Wrong Order #2612

icharlie2 opened this issue Sep 15, 2017 · 1 comment

Comments

@icharlie2
Copy link

icharlie2 commented Sep 15, 2017

Hi guys, in reference to this particular doc page http://redux.js.org/docs/advanced/Middleware.html,

The bottom of Attempt#3 applies the patches in this order:

patchStoreToAddLogging(store)
patchStoreToAddCrashReporting(store)

however in Attempt#4 and higher the patches are applied in the reverse order since
applyMiddlewareByMonkeypatching reverses the array before applying each middleware.

applyMiddlewareByMonkeypatching(store, [logger, crashReporter])

I think that the action should run through the crashReporter prior to the logger, so I believe Attempt#3 is correct and the others are reverse. Can anyone else confirm?

@timdorr
Copy link
Member

timdorr commented Sep 16, 2017

I wouldn't worry too much about the specifics. It's more of a thought exercise than code you should actually expect to run. Hence the docs take several attempts to get at the final result.

@timdorr timdorr closed this as completed Sep 16, 2017
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