The composition API is a new way to write Vue components, based on the use of functions to compose the component, and it makes the organization and reusability of the code better.
This method is inspired by React Hooks and introduces the technique of creating a special function to compose the applications that can be shared without the need to be inside the Vue application because of the use of the exposed Vue APIs.
In this recipe, we will learn how to create an external function that fetches the user's geolocation and displays that data on the screen using the composition API.