Question · Vue.js course · Module 9: Composables & VueUse

Preventing Memory Leaks

What is the most important way to prevent memory leaks in composables?

Answer options

  • Using shallowRef instead of ref
  • Cleaning up timers, listeners, and subscriptions in onUnmounted
  • Using computed instead of watch
  • Avoiding imports from Vue

You can check the correct answer by solving this task in the CodeWorlds game.