Hacker News new | ask | show | jobs
by adriaanmulder 1015 days ago
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