To keep your composables — those extracted functions written using the composition API — neat and easy to read, here's a way to organize the code.
provide
and inject
defineProps
, defineEmits
, and defineExpose
(when using script setup
)refs
and reactive
variablesawait
(or Promises if you're into that sort of thing)Why this order? Because it more or less follows the order of execution of the code.
It's also based on the this linting rule.