Skip to content

Commit

Permalink
docs(firestore): update types & ios return null
Browse files Browse the repository at this point in the history
  • Loading branch information
russellwheatley committed Jun 3, 2020
1 parent 6d0598e commit 27aaa62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/firestore/ios/RNFBFirestore/RNFBFirestoreModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ + (BOOL)requiresMainQueueSetup {
if (error) {
[RNFBFirestoreCommon promiseRejectFirestoreException:reject error:error];
} else {
resolve(nil);
resolve([NSNull null]);
}
}];
}
Expand Down
11 changes: 11 additions & 0 deletions packages/firestore/lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,17 @@ export namespace FirebaseFirestoreTypes {
* @param settings A `Settings` object.
*/
settings(settings: Settings): Promise<void>;
/**
* Aimed primarily at clearing up any data cached from running tests. Needs to be executed before any database calls
* are made.
*
* #### Example
*
*```js
* await firebase.firestore().clearPersistence();
* ```
*/
clearPersistence(): Promise<null>;
}
}

Expand Down

1 comment on commit 27aaa62

@Salakar
Copy link
Member

@Salakar Salakar commented on 27aaa62 Jun 3, 2020

Choose a reason for hiding this comment

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

nil was correct here, should be nil if we want to Promise<void> to match the same types as the Web SDK: https://firebase.google.com/docs/reference/js/firebase.firestore.Firestore#clearpersistence

Please sign in to comment.