Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(database): Type definitions #8373

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

MichaelVerdon
Copy link
Collaborator

Description

Related issues

Release Summary

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
    • Yes
  • My change supports the following platforms;
    • Android
    • iOS
    • Other (macOS, web)
  • My change includes tests;
    • e2e tests added or updated in packages/\*\*/e2e
    • jest tests added or updated in packages/\*\*/__tests__
  • I have updated TypeScript types that are affected by my change.
  • This is a breaking change;
    • Yes
    • No

Test Plan


Think react-native-firebase is great? Please consider supporting the project with any of the below:

Copy link

vercel bot commented Feb 25, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-firebase ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 26, 2025 3:22pm

*/
export function serverTimestamp() {
return firebase.database.ServerValue.TIMESTAMP;
export function getServerTime(db) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why two functions instead of having the first one check if db === undefined, followed by each branch doing the right thing? That idiom is already in a lot of the code, for what it's worth

@@ -220,5 +220,13 @@ export function getServerTime(db: Database): Promise<number>;
*/
export function increment(delta: number): object;

/**
* Logs debugging information to the console.
Copy link
Collaborator

@mikehardy mikehardy Feb 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is not implemented, there should be some indication of why in the docs, also, perhaps not implemented native but is there any reason not to plumb it through for web?

@@ -239,6 +239,10 @@ export function get(query) {
return query.once('value');
}

export function off(query, eventType, callback) {
throw new Error("off() is not implemented");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to enableLogging - if it is not implemented it seems that should be noted in the docs for the method in query.d.ts? And also same as enableLogging, any reason not to plumb it through on web/other implementation (if it is not already)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants