We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35efd80 commit 37c0f93Copy full SHA for 37c0f93
src/loadOnServer.js
@@ -1,14 +1,16 @@
1
-import { beginAsyncLoad, endAsyncLoad } from './actions';
+import { beginAsyncLoad, endAsyncLoad, skipAsyncLoad } from './actions';
2
import flattenComponents from './flattenComponents';
3
import loadAsync from './loadAsync';
4
5
export default function loadOnServer(renderProps, store) {
6
+ const { dispatch } = store;
7
+
8
const flattened = flattenComponents(renderProps.components);
9
if (!flattened.length) {
10
+ dispatch(skipAsyncLoad(true));
11
return Promise.resolve();
12
}
13
- const { dispatch } = store;
14
dispatch(beginAsyncLoad(true));
15
return loadAsync(flattened, renderProps, store).then(
16
(v) => {
0 commit comments