Can I stop datasnapshot when my global boolean is true without waiting ending execution of listener and without limitToFirst. I have some verification in event listener because I need to verify some data and I need make ending in listener
Asked
Active
Viewed 1,849 times
1 Answers
3
You can remove the reference's listener with removeEventListener
.
For example: ref.removeEventListener(listener);
ref
= Reference you initially set the listener on.
listener
= The listener (e.g. this
if called within the listener).

Jake Lee
- 7,549
- 8
- 45
- 86
-
im sorry but how I can understand when listener is removed? – Andrei Gospodarenco Nov 26 '18 at 18:59
-
after removing listener is working, and is removing many times because it is true value in my verification, why it can be – Andrei Gospodarenco Nov 26 '18 at 19:01