Action and Call
Action<S, A> is a server endpoint on the page whose signals are S, which receives arguments A.
Action
Declare one as a const and use the same value on the page and in the router.
| Item | Summary |
|---|---|
Action::post | An action served on POST path. |
Action::get | An action served on GET path, for a read that changes nothing. |
call | A call to this action, which takes no arguments. |
call_with | A call to this action with args. |
path | The path the action is served on, without its Base. |
under | The same action under base, which the page's calls put before the path. |
method | The method the action is served on. |
Method | The HTTP method an Action is served on. |
Call
A Call is usable wherever a Stmt is.
| Item | Summary |
|---|---|
indicator | Sets flag to true while the response is awaited and to false after. |
error | Sets message to the error text when the call fails, and to "" when it is sent. |
latest | Aborts the unfinished earlier latest call to the same action. |
on_error | Runs the statement handle builds when this call fails. |
on_success | Runs next once the server's answer has arrived and its patches are applied. |
then | Sends this call, then runs next without waiting for the answer. |
StreamAction and StreamCall
A stream of patches is served on GET with RouterExt::stream, and only its call can reconnect.
| Item | Summary |
|---|---|
StreamAction::new | A stream served on GET path. |
under | The same stream under base, which the page's calls put before the path. |
call | A call to this stream, which takes no arguments. |
call_with | A call to this stream with args, evaluated in the browser when the call runs. |
connected | Sets flag to true while the server's answer is open, and to false otherwise. |
reconnect | Opens the stream again when its connection fails, breaks off, or answers 5xx. |