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
- Host: GitHub
- URL: https://github.com/thibremy/vue-fetch-composable
- Owner: thibremy
- License: mit
- Created: 2019-07-15T12:19:54.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T13:14:01.000Z (about 5 years ago)
- Last Synced: 2025-01-13T20:25:46.532Z (11 months ago)
- Topics: fetch, vue, vue-composable, vue-composition-api, vue-fn, vue-function-api, vue-hooks
- Language: TypeScript
- Homepage:
- Size: 838 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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
}
}
}
```