|
|
|
|
|
by wishawa
1359 days ago
|
|
You're right that components should intuitively pend forever. But with Async UI, the line between a component and a normal async function is blurry; our login_form eventually returns, so it is a normal async function, but it also renders something, so it is kind of a component... Concretely the login_form function works by racing a render (a true, never-completing component) with a "listener" future that completes when the user submits their login. Once the listener completes, the race is over and the render future gets dropped. We can then return from login_form. |
|
It would also be great to see example code for that - it's the most significant part where I was looking for more information but couldn't find it.
Edit: A bit unrelated, but the tokio vs async-std split continues!
Edit 2: How does error handling work? Is check_login a component or regular request?