refetch on param changes

pull/1319/head^2
Berkeley Martinez 2015-07-19 09:11:08 -07:00
parent 3ce53441f0
commit be6d2a2dfc
2 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,10 @@ export default contain(
getPayload: ({ hikes, params }) => ({
isPrimed: (hikes && !!hikes.length),
dashedName: params.dashedName
})
}),
shouldContainerFetch(props, nextProps) {
return props.params.dashedName !== nextProps.params.dashedName;
}
},
stampit(React, {
displayName: 'Hikes',

View File

@ -19,6 +19,7 @@ function getCurrentHike(hikes =[{}], dashedName, currentHike) {
return currentHike;
}
debug('setting new hike');
return hikes
.filter(({ dashedName }) => {
return filterRegex.test(dashedName);