Comment

Comment by adriaanmulder

Is this really so hard to read?

  updateWhere(
    thing => thing?.guid === postId,
    post => ({...post, title: newTitle}),
    networkCache
  )
The alternatives as far as I can tell are:

- normalize network responses, so you can get the post directly by id. But this is notoriously painful to do well

- or the code that handles this name change needs to know every request that references the post with that id, and update those titles manually

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton