O'Reilly logo

Mastering Reactive JavaScript by Erich de Souza Oliveira

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Service to block messages from a given user

The next service will be used to block messages from a given user. It must return an observable, and this observable cannot propagate messages sent by the blocked user.

Our service will have the following signature:

    blockUser(payload,[observable]);

It receives two parameters, but only the first is mandatory:

  • payload: This is an object containing information about the user to be blocked; it must have two properties:
    • me: This property is mandatory, it is a string representing the user listening to messages
    • blocked: This property is mandatory, it is a string representing the user to be blocked
  • observable: The observable where messages for this user are pushed

Our service must implement the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required