This commit is contained in:
Ilya Kantor 2019-05-22 02:37:20 +03:00
parent db32cd032c
commit 7f1d5de09e
2 changed files with 3 additions and 5 deletions

View file

@ -38,6 +38,6 @@ An alternative solution could be:
askPassword(() => user.loginOk(), () => user.loginFail());
```
Usually that also works, but may fail in more complex situations where `user` has a chance of being overwritten between the moments of asking and running `() => user.loginOk()`.
Usually that also works and looks good.
It's a bit less reliable though in more complex situations where `user` variable might change *after* `askPassword` is called, but *before* the visitor answers and calls `() => user.loginOk()`.