-
Notifications
You must be signed in to change notification settings - Fork 948
Add getQuery(), getQueryFromCache() and getQueryFromServer() #3294
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
Conversation
🦋 Changeset is good to goLatest commit: 97f9664 We got this. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Binary Size ReportAffected SDKs
Test Logs
|
): Promise<QuerySnapshot<T>> { | ||
const internalQuery = cast<Query<T>>(query, Query); | ||
const firestore = cast<Firestore>(query.firestore, Firestore); | ||
return firestore._getFirestoreClient().then(async firestoreClient => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make methods like this fully async? I'm not seeing why they need mixed notation. This applies to the other functions below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The outermost code needs to be async to ensure synchronous function execution, which impacts error propagation and execution order. The cast
calls here, for example, would not throw but cause rejected Promises.
…ase-js-sdk into mrschmidt/getdocfromcache
This adds getQuery(), getQueryFromCache() and getQueryFromServer() as well as a QuerySnapshot that is heavily inspired by the existing SDK's QuerySnapshot.
Most code churn is to allow code reuse.