Skip to content
Discussion options

You must be logged in to vote

Let's tackle this hypothetically, in this scenario we have TextBubble, when a TextBubble finished rendering we are aware the user seen this:

const TextBubble = ({ id, text, read }) => {
  const [, execute] = useMutation(READ);
  useEffect(() => {
     if (!read) execute({ id })
   });
   
   return text;
}

useEffect only fires when a dom-commit happens. Another way to go about this is with a callback, we aggregate the unread message ids and when a user would tap the input-component we'd mark them as read.

I honestly don't think this should be a concern in an exchange/cache since this doesn't accurately follow along with the React-layer if we're talking a suspsenseful or concurrent world.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@kitten
Comment options

@Kingdutch
Comment options

@kitten
Comment options

@Kingdutch
Comment options

@momakes2
Comment options

Answer selected by Kingdutch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants