refactor: make createRouter support async

This commit is contained in:
Clark Du 2018-04-17 15:09:50 +08:00
parent 869fdc2c25
commit 918ce3c15f
No known key found for this signature in database
GPG Key ID: D0E5986AF78B86D9

View File

@ -44,11 +44,7 @@ const defaultTransition = <%=
%> %>
async function createApp (ssrContext) { async function createApp (ssrContext) {
if (createRouter.constructor.name === 'AsyncFunction') {
const router = await createRouter(ssrContext) const router = await createRouter(ssrContext)
} else {
const router = createRouter(ssrContext)
}
<% if (store) { %> <% if (store) { %>
const store = createStore(ssrContext) const store = createStore(ssrContext)