Skip to content

Instantly share code, notes, and snippets.

@rarous
Last active September 1, 2017 14:45
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save rarous/34856a3bfe628eb81c37 to your computer and use it in GitHub Desktop.
Disposable event subsription for Firebase.
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