Last active
July 7, 2017 07:56
-
-
Save ypcode/ba786ab990007c7bbeeb5e8bb4fa3bdc 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
//... | |
private executeOrDelayUntilAuthenticated(action: Function): void { | |
if (this.authenticated) { | |
action(); | |
} else { | |
setTimeout(() => { | |
this.executeOrDelayUntilAuthenticated(action); | |
}, 1000); | |
} | |
} | |
private submitRequest() { | |
this.executeOrDelayUntilAuthenticated(() => { | |
let service = new HardwareRequestProxyService(this.props.httpClient); | |
service.submitRequest(this.currentRequest); | |
}); | |
} | |
//... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment