Skip to content

Commit 110d7f7

Browse files
authored
make initialize return a Promise (#328)
closes #152
1 parent c020704 commit 110d7f7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/definitions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ export interface GoogleAuthPlugin {
143143
* @param options - Optional initialization options.
144144
* @since 3.1.0
145145
*/
146-
initialize(options?: InitOptions): void;
146+
initialize(options?: InitOptions): Promise<void>;
147147

148148
/**
149149
* Initiates the sign-in process and returns a Promise that resolves with the user information.

src/web.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin {
3939
scopes: [],
4040
grantOfflineAccess: false,
4141
}
42-
) {
42+
): Promise<void> {
4343
if (typeof window === 'undefined') {
4444
return;
4545
}
@@ -64,6 +64,7 @@ export class GoogleAuthWeb extends WebPlugin implements GoogleAuthPlugin {
6464
});
6565

6666
this.addUserChangeListener();
67+
return this.gapiLoaded;
6768
}
6869

6970
platformJsLoaded() {

0 commit comments

Comments
 (0)