Last active
September 1, 2017 14:45
-
-
Save rarous/34856a3bfe628eb81c37 to your computer and use it in GitHub Desktop.
Disposable event subsription for Firebase.
This file contains hidden or 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
function subscribe(firebase, event, callback) { | |
firebase.on(event, callback); | |
return { | |
dispose: () => firebase.off(event, callback); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment