Created
April 1, 2018 01:33
-
-
Save outoftime/b1a650f6e7222ffbb4abc9748216b0ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/services/gapi.js b/src/services/gapi.js | |
index 1be368d..345ad9f 100644 | |
--- a/src/services/gapi.js | |
+++ b/src/services/gapi.js | |
@@ -3,13 +3,11 @@ import $S from 'scriptjs'; | |
import once from 'lodash/once'; | |
import config from '../config'; | |
-export async function initGapi() { | |
- return new Promise((resolve) => { | |
- $S('https://apis.google.com/js/client.js', () => { | |
- resolve(gapi); | |
- }); | |
+export const initGapi = once(async() => new Promise((resolve) => { | |
+ $S('https://apis.google.com/js/client.js', () => { | |
+ resolve(gapi); | |
}); | |
-} | |
+})); | |
export async function initGapiClient(gapi) { | |
const client = await new Promise((resolve, reject) => { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment