You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To subscribe to an observable this can be done by creating a class that implements IObserver and subscibe.
However, it is not possible to unsubscribe. When subscribing a reference should be returned so that an observer can unsubscribe.
The IObserver *_observer; should be iterable, so become a list/array and all the observers should be called.
See, for example the Observable base:
Subscibe does not return a reference, but void.
The _observer is only a single observer. but should be some list.
Was looking on Github and https://github.com/ferreirocm/SimpleObservable has a list and a mechanism to unsubscribe.
The (address of the) observer can be used to unsubscribe..
This might give some inspiration?
To subscribe to an observable this can be done by creating a class that implements IObserver and subscibe.
However, it is not possible to unsubscribe. When subscribing a reference should be returned so that an observer can unsubscribe.
The IObserver *_observer; should be iterable, so become a list/array and all the observers should be called.
See, for example the Observable base:
The text was updated successfully, but these errors were encountered: