Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//...
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