-
-
Save oott123/a1001fdfd0d33d8711f5b7aa12f666fe to your computer and use it in GitHub Desktop.
This file contains 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
// login.js | |
let loading = new Promise((resolve, reject) => { | |
$.get('http://example.com/login', (data) => { | |
if (data.login) resolve() | |
}) | |
}) | |
// in other files | |
loading.then(() => { | |
// your logic after login | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment