Question · Vue.js course · Module 4: Computed & Watch

Side effects in computed

Should computed contain side effects (e.g., API calls, localStorage)?

Answer options

  • Yes, it's the ideal place for side effects
  • No, computed should be pure - only return a value
  • Only in the setter of a writable computed
  • It depends on the project size

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