File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " vue-lazy-hydration" ,
3- "version" : " 2.0.0-beta.2 " ,
3+ "version" : " 2.0.0-beta.3 " ,
44 "description" : " Lazy hydration of server-side rendered Vue.js components" ,
55 "keywords" : [
66 " gridsome" ,
Original file line number Diff line number Diff line change 11const isServer = typeof window === `undefined` ;
22
3+ function isAsyncComponentFactory ( componentOrFactory ) {
4+ return typeof componentOrFactory === `function` ;
5+ }
6+
7+ function resolveComponent ( componentOrFactory ) {
8+ if ( isAsyncComponentFactory ( componentOrFactory ) ) {
9+ return componentOrFactory ( ) . then ( componentModule => componentModule . default ) ;
10+ }
11+ return componentOrFactory ;
12+ }
13+
314export function makeNonce ( { component, hydrationPromise } ) {
415 if ( isServer ) return component ;
516
6- return ( ) => hydrationPromise . then ( ( ) => component ) ;
17+ return ( ) => hydrationPromise . then ( ( ) => resolveComponent ( component ) ) ;
718}
You can’t perform that action at this time.
0 commit comments