VuVue · Lesson 5 of 7
Composables
Composables are Vue 3's way of extracting and sharing reactive logic between components. They're just functions that use Vue's Composition API — a composable is to Vue what a custom hook is to React.
✦ Tip
Name composables starting with `use` (like `useFetch`, `useMousePosition`, `useTheme`). Put them in a `composables/` directory. Any logic that involves reactive state and could be used in multiple components is a good candidate for extraction into a composable.
Name composables starting with `use` (like `useFetch`, `useMousePosition`, `useTheme`). Put them in a `composables/` directory. Any logic that involves reactive state and could be used in multiple components is a good candidate for extraction into a composable.