Right now, I'm hesitating between 2 options:
userOffline, and each client must update a local array of online users via a cache merge type policy. Not sure how to re-render the cached array data when one of the subscriptions gets new data.
usersOnlinereturning the list of users, and the client only needs to compare previous and new data to figure out who's just logged in and who's just logged out. On the server side, the subscription triggers a reactive session transaction to toggle a
User.isOnlineboolean, and returns the list of all Users matching isOnline=true.
Which way would you choose for such a feature? Or do you have an alternative suggestion that might be simpler/more efficient?
I might have found a simpler solution.
useLazyQueryto get all online users, with the hook option
subscribeToMoreto get further updates (the internals of subscribeToMore are obscure to me, will need to dive into it).