Hi everyone.
In this video let's add a real time for remote message.
So right now release the video and try to do that okay.
Let's think a little bit and try to create the real time folder remote okay.
So how about your solution.
Let me show you how I can do that.
Let's take a little bit right here.
In order to remove the message we need the ID right.
And let him how the front end can consume the data from the subject server okay.
The socket server will emit the event to the front end.
And let's take a little bit about how the front end can remove that okay.
Possible.
In the in the front end we have a list of messages okay.
And we want to Remove sub message from dask array.
How we can do that?
Well, if you think in very similar.
We have a arrays.
Okay.
And in order to remove we should filter out us right.
We can use filter method.
Okay.
We will remove using this one.
Right.
It means the socket error here is somehow send the ID and not the right.
Okay.
After we already found the message, we will have something like message, right?
And we just need to update update that for example like file message.
And we just need to or actually this is not removed entirely.
We just need to update the message which is deleted.
Right.
So for that reason in the front end, we will yield something like that, like file index.
Okay.
After we already found the index, we just need to know the message right here.
Right.
Dot index and dot delete.
We need to update it back to false.
And we will set the new style.
Okay.
With this information.
Okay.
That's how frontend can consume this data.
It means right now in the socket data right here we need the underscore ID okay.
We just need to send the underscore ID about what message we want to remove.
And the frontend it will consume that and it will remove from that array okay.
It Between.
With this way, the front end will handle the logic.
Okay, the front end will.
File the message and update its back to true.
Alright, so that's about the solution.
It means right here what we need to do.
We need to create the message gateway okay.
Handler.
Remove message.
Right here we need to send the ID okay.
Maybe I will call the message over here.
And I will say that this dot server.
And we also need the conversation.
Right.
Pre-war prices.
Were okay.
We just need to send a message.
And a broader client and client will care about us.
So it's a message of it.
I will call this message gateway dot handle, remove message and move the conversation.
And message and I will come from message over here underscore ID okay.
And dot two string also.
So that is very easy right.
So I hope you right now already got the idea.
And so the next part will be the marketing message.
So please pause the video and uh let's do that.
I will see you in the next one.