firebase / firebase/firebase-js-sdk

Add [DEPRECATED] to off

Open
#7,846 0 comments 0 reactions 0 assignees View on GitHub
api: database needs-attention question
Dominant language
TypeScript
Stars
5.1k
Forks
1k
Avg merge
2d 21h
Merged PRs (30d)
37

Description

### Operating System

macOS

### Browser Version

Safari 16.5.2

### Firebase SDK Version

10.7.0

### Firebase SDK Product:

Database

### Describe your project's tooling

index.html with source tag. Just javascript.

### Describe the problem

The [off](https://firebase.google.com/docs/reference/js/database.md#off) method exists but at the same time the documentation says _Note: This is not the recommended way to remove a listener. Instead, please use the returned callback function from the respective on* callbacks._ which leads me to believe that this method comes from the old v8 api and only still exists for compatibility reasons and to facilitate people moving from v8 to v9. Is there a legitimate case where I should use this method instead of the returned callback from the _on_ methods?

### Steps and code to reproduce issue

Already explained.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.