Skip to content

Commit 079d642

Browse files
committed
Responded to reviewer comments
1 parent 69a6f7b commit 079d642

File tree

6 files changed

+28
-12
lines changed

6 files changed

+28
-12
lines changed

packages-exp/auth-compat-exp/index.rn.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
import { AsyncStorage } from 'react-native';
2626
import { ReactNativePersistence } from '@firebase/auth-exp/src/core/persistence/react_native';
2727

28-
const _reactNativeLocalPersistence = new ReactNativePersistence(AsyncStorage);
28+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
29+
const reactNativeLocalPersistence = new ReactNativePersistence(AsyncStorage);

packages-exp/auth-compat-exp/react-native.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
declare module 'react-native' {
2929
interface ReactNativeAsyncStorage {
30-
setItem(key: string, value: string): Promise<void>
31-
getItem(key: string): Promise<string | null>
32-
removeItem(key: string): Promise<void>
30+
setItem(key: string, value: string): Promise<void>;
31+
getItem(key: string): Promise<string | null>;
32+
removeItem(key: string): Promise<void>;
3333
}
3434
export const AsyncStorage: ReactNativeAsyncStorage;
3535
}

packages-exp/auth-exp/src/core/persistence/react_native.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class FakeAsyncStorage implements ReactNativeAsyncStorage {
3232

3333
async getItem(key: string): Promise<string | null> {
3434
const value = this.storage[key];
35-
return value === undefined ? null : value;
35+
return value ?? null;
3636
}
3737
async removeItem(key: string): Promise<void> {
3838
delete this.storage[key];

packages-exp/auth-exp/src/core/persistence/react_native.ts

+1-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,8 @@ import {ReactNativeAsyncStorage} from '@firebase/auth-types-exp';
2828
*/
2929
export class ReactNativePersistence implements Persistence {
3030
readonly type: PersistenceType = PersistenceType.LOCAL;
31-
private readonly storage: ReactNativeAsyncStorage;
3231

33-
constructor(storage: ReactNativeAsyncStorage) {
34-
this.storage = storage;
35-
}
32+
constructor(private readonly storage: ReactNativeAsyncStorage) {}
3633

3734
async isAvailable(): Promise<boolean> {
3835
try {

packages-exp/auth-types-exp/index.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717

1818
export interface ReactNativeAsyncStorage {
19-
setItem(key: string, value: string): Promise<void>
20-
getItem(key: string): Promise<string | null>
21-
removeItem(key: string): Promise<void>
19+
setItem(key: string, value: string): Promise<void>;
20+
getItem(key: string): Promise<string | null>;
21+
removeItem(key: string): Promise<void>;
2222
}

yarn.lock

+18
Original file line numberDiff line numberDiff line change
@@ -12592,6 +12592,17 @@ [email protected]:
1259212592
rollup-pluginutils "2.8.2"
1259312593
tslib "1.10.0"
1259412594

12595+
12596+
version "0.26.0"
12597+
resolved "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.26.0.tgz#cee2b44d51d9623686656d76dc30a73c4de91672"
12598+
integrity sha512-lUK7XZVG77tu8dmv1L/0LZFlavED/5Yo6e4iMMl6fdox/yKdj4IFRRPPJEXNdmEaT1nDQQeCi7b5IwKHffMNeg==
12599+
dependencies:
12600+
find-cache-dir "^3.2.0"
12601+
fs-extra "8.1.0"
12602+
resolve "1.15.1"
12603+
rollup-pluginutils "2.8.2"
12604+
tslib "1.10.0"
12605+
1259512606
1259612607
version "0.27.0"
1259712608
resolved "https://registry.npmjs.org/rollup-plugin-typescript2/-/rollup-plugin-typescript2-0.27.0.tgz#95ff96f9e07d5000a9d2df4d76b548f9a1f83511"
@@ -12613,6 +12624,13 @@ [email protected]:
1261312624
serialize-javascript "^2.1.2"
1261412625
uglify-js "^3.4.9"
1261512626

12627+
12628+
version "2.8.1"
12629+
resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.1.tgz#8fa6dd0697344938ef26c2c09d2488ce9e33ce97"
12630+
integrity sha512-J5oAoysWar6GuZo0s+3bZ6sVZAC0pfqKz68De7ZgDi5z63jOVZn1uJL/+z1jeKHNbGII8kAyHF5q8LnxSX5lQg==
12631+
dependencies:
12632+
estree-walker "^0.6.1"
12633+
1261612634
[email protected], rollup-pluginutils@^2.5.0, rollup-pluginutils@^2.6.0, rollup-pluginutils@^2.8.1, rollup-pluginutils@^2.8.2:
1261712635
version "2.8.2"
1261812636
resolved "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz#72f2af0748b592364dbd3389e600e5a9444a351e"

0 commit comments

Comments
 (0)