File tree 1 file changed +4
-5
lines changed
packages/database/src/api
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -1600,12 +1600,11 @@ export function onChildRemoved(
1600
1600
export { EventType } ;
1601
1601
1602
1602
/**
1603
- * Detaches a callback previously attached with `on()`.
1603
+ * Detaches a callback previously attached with the corresponding `on*()` (`onValue`, `onChildAdded`) listener.
1604
+ * Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from
1605
+ * the respective `on*` callbacks.
1604
1606
*
1605
- * Detach a callback previously attached with `on()`. Note that if `on()` was
1606
- * called multiple times with the same eventType and callback, the callback
1607
- * will be called multiple times for each event, and `off()` must be called
1608
- * multiple times to remove the callback. Calling `off()` on a parent listener
1607
+ * Detach a callback previously attached with `on*()`. Calling `off()` on a parent listener
1609
1608
* will not automatically remove listeners registered on child nodes, `off()`
1610
1609
* must also be called on any child listeners to remove the callback.
1611
1610
*
You can’t perform that action at this time.
0 commit comments