-
Notifications
You must be signed in to change notification settings - Fork 444
return a listener+path from firebase._addObservers #129
Comments
Great suggestion, I'm on it! |
Btw would it be convenient/logical to indeed include the |
Hi, I've added this feature to the master branch, but there's a caveat, see this issue in the Android Runtime repo I just created. So if you only need iOS, or only one type of listener (value or child) then you're good. If you need to remove both types of listeners on Android then you'll run into this issue. The TS definition has been updated according to this change, as well as the demo app so that should make clear how it works. Not that on iOS the child event thingy actually creates 4 listeners so that's why I'm returning an array of listeners, and offer a Let me know what you think, |
Hi, that's a great work! I've reviewed the code just now (not tested yet) and just one thing came to mind: |
@andrew19881123 That makes sense. I added the singular version for convenience but perhaps it's just only confusing folks. |
OK, that's done. |
Btw that NativeScript-Android issue has been fixed and the kind folks at NativeScript will ship the fix with the next release. So we made the framework better with this feature as well 👍 |
Note that {N} 2.3.0 is now released and indeed fixes this issue. Shiptime! |
Hi Eddy, i want to propose you some little changes so we can use the
removeEventListener
first we return an object with path and listener from the _addObservers
and we resolve the promise with it
we return the same obj here
and then again we resolve the promise with the obj
of course in the query we don't have to think about the singleEvent option because that listener should die after the first call.
I imagine the listenerPlusPathObj like
in this way we can call
removeEventListener(obj.listener, obj.path);
now we have all the tools to use the
firebase.removeEventListener = function (listener, path)
which is also very useful for my porting of geofire as a garbage collector for all the unused listeners.what do you think? any problems or better ideas?
The text was updated successfully, but these errors were encountered: