function handleUpdateItems(items) { items.forEach(function(item) { if (item.deleted || item.error) { return } if (item.type == 'comment') { commentUpdates[item.id] = item } else { storyUpdates[item.id] = item } }) sortedCommentUpdates = updateCache(commentUpdates) sortedStoryUpdates = updateCache(storyUpdates) ItemStore.emitUpdates() }