git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit c89794caeffafc465f3dd30e6a332ec2581775ec

defer fetch till next tick

this way we don't fetch during a render and annoy react
Michael Williams committed on 1/8/2016, 5:50:45 AM
Parent: 5aaa7567ce018bfe4ea54d34371929683870a809

Files changed

app/util/fetch-element.jschanged
app/util/fetch-element.jsView
@@ -2,12 +2,14 @@
22
33 export default function fetchElement (store) {
44 return function (Component, props) {
55 if (Component.fetchData) {
6- Component.fetchData(
7- store.getState, store.dispatch,
8- props.location, props.params
9- )
6+ process.nextTick(function () {
7+ Component.fetchData(
8+ store.getState, store.dispatch,
9+ props.location, props.params
10+ )
11+ })
1012 }
1113 return React.createElement(Component, props)
1214 }
1315 }

Built with git-ssb-web