I am trying to find the best approach to storing data in a get-stream and how to retrieve data in real time on the client side.
For example, let's say I have a user and they have an image. When they create a message, I add an action:
const eventStreamPromise = eventStream.addActivity({
actor: event,
verb: 'post',
object: postId,
foreign_id: postId,
postText: 'some text',
user: 'internalUserId',
});
I would think that I would only use the link to the user, and this is normal when I load the initial download (I pull the channel from the client side). But then I’m not sure of the best way to get this data when I subscribe to a channel on the client side.
this.getStreamListener = feed
.subscribe((data) {
console.log(data, 'got feed data, now what?');
})
.then(() {
console.log('now listening to changes in realtime');
})
.catch((error) => {
console.log('error', error);
});
Any advice is appreciated!
source
share