Skip to content

Commit 7db8c7e

Browse files
committed
use finally to remove duplication
- [Release notes](https://github.com/jbgutierrez/path-parse/releases) - [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7) --- updated-dependencies: - dependency-name: path-parse dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> fix import typo in full example code block Fix import statement typo in Full Example code block of useCreateUserWithEmailAndPassword hook use finally
1 parent 1d1ca28 commit 7db8c7e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

auth/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Returns:
105105
#### Full Example
106106

107107
```jsx
108-
import { useSignInWithEmailAndPassword } from 'react-firebase-hooks/auth';
108+
import { useCreateUserWithEmailAndPassword } from 'react-firebase-hooks/auth';
109109

110110
const SignIn = () => {
111111
const [email, setEmail] = useState('');

auth/useCreateUserWithEmailAndPassword.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export default (
2424
await user.user.sendEmailVerification(options.emailVerificationOptions);
2525
}
2626
setRegisteredUser(user);
27-
setLoading(false);
2827
} catch (error) {
2928
setError(error);
29+
} finally {
3030
setLoading(false);
3131
}
3232
};

auth/useSignInWithEmailAndPassword.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export default (auth: firebase.auth.Auth): EmailAndPasswordActionHook => {
1818
try {
1919
const user = await auth.signInWithEmailAndPassword(email, password);
2020
setLoggedInUser(user);
21-
setLoading(false);
2221
} catch (err) {
2322
setError(err);
23+
} finally {
2424
setLoading(false);
2525
}
2626
};

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)