Updating existing notes

In order to edit an existing note, we could reuse the NoteEditor component. Right now, this component is linked to the currentNote property of the main store, but we could use a property to pass the note to be edited, thereby removing its dependency from the main store. This kind of generalization is common while developing Vuex applications, and often leads to two kinds of components:

  • Dumb components: These do not alter or handle application states; they just receive input through properties and dispatch events
  • Smart components: These serve as containers for the dumb components; they handle interactions between child components and are dependent on Vuex elements, such as application states and actions

A dumb component ...

Get Vuex Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.