The new Composition API is still a RFC. This example is using @vue/composition-api plugin which allows to test the new API in Vue 2.x.
Clone the repository & install dependencies:
$ git clone https://github.com/pmagaz/vue-composition-api
$ yarn / npm install
This example uses parcel as build tool / development server. To launch the server use the following command:
$ yarn start
ApiCall.vue
Example using value, computeed and watch to make an API call.ApiCallComposition.vue
Improved example isolating logic with composition function.ApiCallCompositionReactive.vue
Same example using reactive instead ref.
Vue 3 Function API is still an RFC that could have changes. This repository and its examples were made for educational purposes only. DON'T use them in production.