const usernameValidator = [
usernameIsAvailableTwoStage
let usernameResult = validate(usernameValidator, username);
if (usernameResult.validateAsync) {
usernameResult.validateAsync().then((asyncResult) => {
if (asyncResult.value === username) {
// this will not be reached since
// the username has changed
usernameResult = asyncResult;