Our next service will be used to listen to new messages. It must return an observable containing the data, the destination of which is the given user.
Our service will have the following signature:
It receives two parameters, but only the first is mandatory:
- payload: It is an object containing information about the user, and it must have one property:
- me: This property is mandatory - it is a string representing the user listening to messages
- observable: It is the observable where messages are pushed
Our service must implement the following rules:
- Must return an observable containing only data for the given user, which means messages sent by the given user, private ...