Unplugging subscribers

We saw how to subscribe to an EventStream and property using onValue, onError, and onEnd. We can also unsubscribe the subscribers if we don't need them anymore.

These functions return a function for unsubscribing. To unsubscribe, we need to call the function returned by the subscriber function.

Get JavaScript: Moving to ES2015 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.