An open API service indexing awesome lists of open source software.

https://github.com/thibremy/vue-fetch-composable

Vue function for isomorphic http requests
https://github.com/thibremy/vue-fetch-composable

fetch vue vue-composable vue-composition-api vue-fn vue-function-api vue-hooks

Last synced: about 2 months ago
JSON representation

Vue function for isomorphic http requests

Awesome Lists containing this project

README

          

# vue-fetch-composable

Isomorphic fetch hook that should|will works with SSR (server side rendering).

```



Loading...


{{ text }}


import { watch } from 'vue'
import { useFetch } from 'vue-fetch-composable'

export default {
setup(props) {
const { fetch, isFetching, isCompleted, abort, text } = useFetch('http://google.com')

watch(() => props.search, async (search) => {
abort()
fetch(`?search=${search}`)
})

return {
isFetching
text
}
}
}

```