-
Notifications
You must be signed in to change notification settings - Fork 647
Officially document @@router/LOCATION_CHANGE #298
Comments
Maybe I'm misunderstanding, but isn't it exported already? (Although I agree some additional documentation wouldn't hurt.) |
Yup, I didn't even see it there. It changed names since 3.0.0, and the old one didn't work, and the new one isn't documented, so I just assumed it wasn't being exported anymore. |
PRs to the docs are welcome 😉 |
The name changed because the behavior changed. The previous action used to fire before the history was requested to change via action creators. The new action is fired after any history change, and regardless of how it’s done (e.g. |
Interesting. I wasn't using the action creators directly; I would see that action come through when clicking on a router |
Oops. I looked it up and you’re right, it did work this way before as well. |
Interesting use case. Could you hook into those async actions with a callback on the component that gets called when they complete? That could be useful for components that aren't tied to a URL (such as a modal or something). Just another suggestion. I can get to this soon. But if someone wants to beat me with a PR, go for it! 😄 |
Beat you to it :) lemme know if I missed anything. |
Oh I see it has something can be improved in doc. Because it(LOCATION_CHANGE) changed names since 3.0.0(in this year), so doc should show it. I edit it and add PR. in #334 |
I do have a use case for
@@router/LOCATION_CHANGE
: I have to show one element on my page after all other elements have completed loading (asynchronously). For this, I have a boolean flag in my state that is set tofalse
on@@router/LOCATION_CHANGE
and set totrue
by another action when all the elements have completed loading.Please export a constant like what used to be done with
UPDATE_LOCATION
, so that I can use an officially documented action rather than a magic string.The text was updated successfully, but these errors were encountered: