Read-time updates: better to use useEffect, web sockets or something else?

Viewed 17

I'm early in the process of learning nest.js + React. I'm building a note-taking app, and I'd like there to be different kinds of real-time updating, e.g.:

  1. There's a list of all your notes in a sidebar, and when you create / delete a note, the list in the sidebar should automatically update
  2. If you have a note open and you're editing it, it should auto-save as you edit. In the future, any other window where you have that note open should reflect any live edits

Are these kinds of real-time updates best achieved with React's useEffect, web sockets or some other implementation? Hoping for a pointer on which direction to take this (and to learn!)

1 Answers
  1. Regarding the first one, this can be achieved with useEffect
  2. You can use service workers to achieve the infra-tab ( client side ) sync.
Related