Skip to content
This repository has been archived by the owner on Oct 26, 2018. It is now read-only.

Clarify usage with Immutable.js #415

Closed
sfentress opened this issue Jun 27, 2016 · 1 comment
Closed

Clarify usage with Immutable.js #415

sfentress opened this issue Jun 27, 2016 · 1 comment

Comments

@sfentress
Copy link
Contributor

In the readme, it says

Provide your own reducer function that will receive actions of type LOCATION_CHANGE and return the payload merged into state.

This isn't enough information, and the user needs to look through the source code to understand where to actually put the data.

Can we change this to something like

  1. Provide your own reducer function that will receive actions of type LOCATION_CHANGE and return the payload merged into the locationBeforeTransitions property of the routing state. e.g. state.set("routing", {locationBeforeTransitions: action.payload}).
@timdorr
Copy link
Member

timdorr commented Jun 27, 2016

I'd be happy to accept a PR for this change. We can discuss specific changes that way.

sfentress added a commit to sfentress/react-router-redux that referenced this issue Jun 28, 2016
1. It was easier for me to think of the reducer by first knowing where
the state was expected to be. Writing it the other way around was
confusing
2. Add that the action payload data must go into the 
`locationBeforeTransitions` property

reactjs#415
timdorr pushed a commit that referenced this issue Jun 28, 2016
1. It was easier for me to think of the reducer by first knowing where
the state was expected to be. Writing it the other way around was
confusing
2. Add that the action payload data must go into the 
`locationBeforeTransitions` property

#415
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants