Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Adding support for Firebase events and $off / $unbind methods.#202

Closed
elkorn wants to merge 5 commits intoFirebaseExtended:masterfrom
elkorn:master
Closed

Adding support for Firebase events and $off / $unbind methods.#202
elkorn wants to merge 5 commits intoFirebaseExtended:masterfrom
elkorn:master

Conversation

@elkorn
Copy link
Contributor

@elkorn elkorn commented Jan 4, 2014

Cheers!
While creating a collaborative app in AngularJS I had naturally decided to use AngularFire, since it's awesome. :)
However, I have soon found out that change and loaded events are not enough for me, especially that they have not provided the snapshot and prevChild data for handlers.

The pull request consists of precisely this functionality, plus $off(type, handler) (unbinding a specific handler from an event) and $unbind(type) (unbinding all handlers from an event).

The test suite passes BUT I have not added any new tests (I'm 'testing' the events continuously on my app, so did not have the need) - I can do that if it's a necessity- but at a later moment, I'm currently under considerable time pressure.

Hope you find this PR of value. :)

@anantn
Copy link
Contributor

anantn commented Jan 10, 2014

Lovely! Can I buy you a couple of 🍻 - or a non-alcoholic beverage of choice? 😄

@anantn
Copy link
Contributor

anantn commented Jan 10, 2014

I'm going to make a couple of tweaks to this PR but it mostly looks good! I'll be removing the $unbind method (the names implies it's the opposite of $bind, which it is not), and rolling that functionality into calling $off without a callback argument.

@anantn
Copy link
Contributor

anantn commented Jan 10, 2014

Committed in 7c8c92d

@anantn anantn closed this Jan 10, 2014
@elkorn
Copy link
Contributor Author

elkorn commented Jan 12, 2014

Glad to be of help. 😃

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants