lelandrichardson / redux-pack

Sensible promise handling and middleware for redux
MIT License
1.33k stars 60 forks source link

Destructured store arg in middleware function #35

Closed therewillbecode closed 7 years ago

therewillbecode commented 7 years ago

Use destructuring in arg in order to avoid misleading variable name. Variable was called store however as middleware is passed only the dispatch and getState methods of the store. Therefore naming this arg "store" is misleading as argument does not represent the entire store but only a subset of it comprising 2 methods.

evandavis commented 7 years ago

Why? This is consistent with the official redux doc examples.

therewillbecode commented 7 years ago

My reasoning was just that something shouldn't have the same name as something else if it is different to that thing.