PostsBlogReposAbout
Samuel5 May 2024
spot the bug
function getItemsWithNext() {
  return items
    .filter(item => {
      if (isDeleted(item)) {
        return false
      }
      return true
    })
    .map((item, i) => {
      const next = items[i + 1]
      return {
        item,
        next,
      }
    })
} 18 1 32
Exhaustion Party5 May 2024
const next considers the items array when it should be considering the filtered array, making next sometimes incorrect?
1 2
Samuel
@samuel.fm
Yep
2
5 May 2024 at 10:03 amView on Bluesky