Design-Patterns icon indicating copy to clipboard operation
Design-Patterns copied to clipboard

Observer with subscription

Open tonilopezmr opened this issue 7 years ago • 0 comments

You can notify for all observers but some observers can subscribed and unsuscribed in any moment, this is very common in Android because Screens are subscribed and unsuscribed every time.

Example output:

Value: First request a value and updates
Value: Third request a value

Notify: Toni
First updated: Toni
Second updated: Toni

Notify: Cotel
First updated: Cotel
Second updated: Cotel

Unregister all

Notify: Fran
Nothing happens

Register first and second

Notify: That's all
First updated: That's all
Second updated: That's all

Coverage:

screen shot 2017-06-03 at 13 18 20

tonilopezmr avatar Jun 03 '17 11:06 tonilopezmr