Skip to content

Commit

Permalink
Ran lint --fix in @realm/react
Browse files Browse the repository at this point in the history
  • Loading branch information
kraenhansen committed Jun 21, 2023
1 parent 0c7360f commit 9dc9f99
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 36 deletions.
1 change: 0 additions & 1 deletion packages/realm-react/src/AppProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const AppProvider: React.FC<AppProviderProps> = ({ children, appRef, ...a

/**
* Hook to access the current {@link Realm.App} from the {@link AppProvider} context.
*
* @throws if an AppProvider does not exist in the component’s ancestors
*/
export const useApp = <
Expand Down
4 changes: 0 additions & 4 deletions packages/realm-react/src/RealmProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ type ProviderProps = PartialRealmConfiguration & {

/**
* Generates a `RealmProvider` given a {@link Realm.Configuration} and {@link React.Context}.
*
* @param realmConfig - The configuration of the Realm to be instantiated
* @param RealmContext - The context that will contain the Realm instance
* @returns a RealmProvider component that provides context to all context hooks
Expand All @@ -45,7 +44,6 @@ export function createRealmProvider(
/**
* Returns a Context Provider component that is required to wrap any component using
* the Realm hooks.
*
* @example
* ```
* const AppRoot = () => {
Expand Down Expand Up @@ -151,7 +149,6 @@ export function createRealmProvider(
/**
* Merge two configurations, creating a configuration using `configA` as the default,
* merged with `configB`, with properties in `configB` overriding `configA`.
*
* @param configA - The default config object
* @param configB - Config overrides object
* @returns Merged config object
Expand All @@ -176,7 +173,6 @@ export function mergeRealmConfiguration(

/**
* Utility function that does a deep comparison (key: value) of object a with object b
*
* @param a - Object to compare
* @param b - Object to compare
* @returns True if the objects are identical
Expand Down
16 changes: 0 additions & 16 deletions packages/realm-react/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type RealmContext = {
/**
* The Provider component that is required to wrap any component using
* the Realm hooks.
*
* @example
* ```
* const AppRoot = () => {
Expand All @@ -53,12 +52,10 @@ type RealmContext = {
RealmProvider: ReturnType<typeof createRealmProvider>;
/**
* Returns the instance of the {@link Realm} opened by the `RealmProvider`.
*
* @example
* ```
* const realm = useRealm();
* ```
*
* @returns a realm instance
*/
useRealm: ReturnType<typeof createUseRealm>;
Expand All @@ -70,7 +67,6 @@ type RealmContext = {
* The result of this can be consumed directly by the `data` argument of any React Native
* VirtualizedList or FlatList. If the component used for the list's `renderItem` prop is {@link React.Memo}ized,
* then only the modified object will re-render.
*
* @example
* ```tsx
* // Return all collection items
Expand All @@ -79,7 +75,6 @@ type RealmContext = {
* // Return all collection items sorted by name and filtered by category
* const filteredAndSorted = useQuery(Object, (collection) => collection.filtered('category == $0',category).sorted('name'), [category]);
* ```
*
* @param type - The object type, depicted by a string or a class extending Realm.Object
* @param query - A function that takes a {@link Realm.Collection} and returns a {@link Realm.Collection} of the same type.
* This allows for filtering and sorting of the collection, before it is returned.
Expand All @@ -91,12 +86,10 @@ type RealmContext = {
* Returns a {@link Realm.Object} from a given type and value of primary key.
* The hook will update on any changes to the properties on the returned object
* and return null if it either doesn't exists or has been deleted.
*
* @example
* ```
* const object = useObject(ObjectClass, objectId);
* ```
*
* @param type - The object type, depicted by a string or a class extending {@link Realm.Object}
* @param primaryKey - The primary key of the desired object which will be retrieved using {@link Realm.objectForPrimaryKey}
* @returns either the desired {@link Realm.Object} or `null` in the case of it being deleted or not existing.
Expand All @@ -106,7 +99,6 @@ type RealmContext = {

/**
* Creates Realm React hooks and Provider component for a given Realm configuration
*
* @example
* ```
*class Task extends Realm.Object {
Expand All @@ -123,7 +115,6 @@ type RealmContext = {
*
*const {useRealm, useQuery, useObject, RealmProvider} = createRealmContext({schema: [Task]});
* ```
*
* @param realmConfig - {@link Realm.Configuration} used to open the Realm
* @returns An object containing a `RealmProvider` component, and `useRealm`, `useQuery` and `useObject` hooks
*/
Expand All @@ -150,7 +141,6 @@ const defaultContext = createRealmContext();
/**
* The Provider component that is required to wrap any component using
* the Realm hooks.
*
* @example
* ```
* const AppRoot = () => {
Expand All @@ -173,12 +163,10 @@ export const RealmProvider = defaultContext.RealmProvider;

/**
* Returns the instance of the {@link Realm} opened by the `RealmProvider`.
*
* @example
* ```
* const realm = useRealm();
* ```
*
* @returns a realm instance
*/
export const useRealm = defaultContext.useRealm;
Expand All @@ -191,7 +179,6 @@ export const useRealm = defaultContext.useRealm;
* The result of this can be consumed directly by the `data` argument of any React Native
* VirtualizedList or FlatList. If the component used for the list's `renderItem` prop is {@link React.Memo}ized,
* then only the modified object will re-render.
*
* @example
* ```tsx
* // Return all collection items
Expand All @@ -200,7 +187,6 @@ export const useRealm = defaultContext.useRealm;
* // Return all collection items sorted by name and filtered by category
* const filteredAndSorted = useQuery(Object, (collection) => collection.filtered('category == $0',category).sorted('name'), [category]);
* ```
*
* @param type - The object type, depicted by a string or a class extending Realm.Object
* @param query - A function that takes a {@link Realm.Collection} and returns a {@link Realm.Collection} of the same type.
* This allows for filtering and sorting of the collection, before it is returned.
Expand All @@ -213,12 +199,10 @@ export const useQuery = defaultContext.useQuery;
* Returns a {@link Realm.Object} from a given type and value of primary key.
* The hook will update on any changes to the properties on the returned object
* and return null if it either doesn't exists or has been deleted.
*
* @example
* ```
* const object = useObject(ObjectClass, objectId);
* ```
*
* @param type - The object type, depicted by a string or a class extending {@link Realm.Object}
* @param primaryKey - The primary key of the desired object which will be retrieved using {@link Realm.objectForPrimaryKey}
* @returns either the desired {@link Realm.Object} or `null` in the case of it being deleted or not existing.
Expand Down
2 changes: 0 additions & 2 deletions packages/realm-react/src/useAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ interface UseAuth {

/**
* Log in with the Anonymous authentication provider.
*
* @returns A `Realm.User` instance for the logged in user.
* @see https://www.mongodb.com/docs/atlas/app-services/authentication/anonymous/
*/
Expand Down Expand Up @@ -106,7 +105,6 @@ interface UseAuth {
* `loginResult.pending` to render a spinner when login is in progress, without
* needing to pass that state around or store it somewhere global in their app
* code.
*
* @returns An object containing operations and state for authenticating with an Atlas App.
*/
export function useAuth(): UseAuth {
Expand Down
10 changes: 0 additions & 10 deletions packages/realm-react/src/useEmailPasswordAuth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,57 +26,49 @@ interface UseEmailPasswordAuth {
/**
* Convenience function to log in a user with an email and password - users
* could also call `logIn(Realm.Credentials.emailPassword(email, password))`.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#add-appprovider-to-work-with-email-password-users
*/
logIn(credentials: { email: string; password: string }): void;

/**
* Register a new user.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#register-a-new-user-account
*/
register(args: { email: string; password: string }): void;

/**
* Confirm a user's account by providing the `token` and `tokenId` received.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#confirm-a-new-user-s-email-address
*/
confirm(args: { token: string; tokenId: string }): void;

/**
* Resend a user's confirmation email.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#resend-a-confirmation-email
*/
resendConfirmationEmail(args: { email: string }): void;

/**
* Retry the custom confirmation function for a given user.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#retry-a-user-confirmation-function
*/
retryCustomConfirmation(args: { email: string }): void;

/**
* Send a password reset email for a given user.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#send-a-password-reset-email
*/
sendResetPasswordEmail(args: { email: string }): void;

/**
* Complete resetting a user's password.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#send-a-password-reset-email
*/
resetPassword(args: { token: string; tokenId: string; password: string }): void;

/**
* Call the configured password reset function, passing in any additional
* arguments to the function.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/manage-email-password-users/#call-a-password-reset-function
*/
callResetPasswordFunction<Args extends unknown[] = []>(
Expand All @@ -89,7 +81,6 @@ interface UseEmailPasswordAuth {

/**
* Log out the current user.
*
* @see https://www.mongodb.com/docs/realm/sdk/react-native/manage-users/authenticate-users/#log-a-user-out
*/
logOut(): void;
Expand All @@ -113,7 +104,6 @@ interface UseEmailPasswordAuth {
* `result.pending` to render a spinner when login is in progress, without
* needing to pass that state around or store it somewhere global in their app
* code.
*
* @returns An object containing operations and state related to Email/Password authentication.
*/
export function useEmailPasswordAuth(): UseEmailPasswordAuth {
Expand Down
1 change: 0 additions & 1 deletion packages/realm-react/src/useObject.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { CollectionCallback, getObjectForPrimaryKey, getObjects } from "./helper

/**
* Generates the `useObject` hook from a given `useRealm` hook.
*
* @param useRealm - Hook that returns an open Realm instance
* @returns useObject - Hook that is used to gain access to a single Realm object from a primary key
*/
Expand Down
1 change: 0 additions & 1 deletion packages/realm-react/src/useQuery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ type DependencyList = ReadonlyArray<unknown>;

/**
* Generates the `useQuery` hook from a given `useRealm` hook.
*
* @param useRealm - Hook that returns an open Realm instance
* @returns useObject - Hook that is used to gain access to a {@link Realm.Collection}
*/
Expand Down
1 change: 0 additions & 1 deletion packages/realm-react/src/useRealm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import { useContext } from "react";
/**
* Generates a `useRealm` hook given a RealmContext. This allows access to the {@link Realm}
* instance anywhere within the RealmProvider.
*
* @param RealmContext - The context containing the {@link Realm} instance
* @returns useRealm - Hook that is used to gain access to the {@link Realm} instance
*/
Expand Down

0 comments on commit 9dc9f99

Please sign in to comment.