Last active
October 19, 2021 13:08
-
-
Save AhmedTarekHasan/b1173d1e32568101445f3036a2786199 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
. | |
. | |
. | |
let subscribersStateChangeNotificationCallback = (subscriberFound) => { | |
if(!subscriberFound && isNowWatching) { | |
stopWatching(); | |
isNowWatching = false; | |
} else if(subscriberFound && !isNowWatching) { | |
startWatching(); | |
} | |
}; | |
self.data = new Subject(subscribersStateChangeNotificationCallback); | |
. | |
. | |
. | |
self.data.next(self.snapshot.data); | |
. | |
. | |
. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment