Skip to content

Commit

Permalink
fix: use own onServerPrefetch for useFetch
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 4, 2020
1 parent 3ba85f5 commit 60e23dd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import Vue from 'vue'
import {
getCurrentInstance,
onServerPrefetch,
onBeforeMount,
} from '@vue/composition-api'
import { getCurrentInstance, onBeforeMount } from '@vue/composition-api'

import { onServerPrefetch } from './ssr-ref'

import { ComponentInstance } from '@vue/composition-api/dist/component'

Expand Down Expand Up @@ -139,7 +137,7 @@ export const useFetch = (callback: Fetch) => {
vm._fetchOnServer = vm.$options.fetchOnServer !== false
}

onServerPrefetch(serverPrefetch)
onServerPrefetch(() => serverPrefetch(vm))

onBeforeMount(() => {
if (!vm._hydrated) {
Expand Down

0 comments on commit 60e23dd

Please sign in to comment.