日本語

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.

ItemSummary
Action::postAn action served on POST path.
Action::getAn action served on GET path, for a read that changes nothing.
callA call to this action, which takes no arguments.
call_withA call to this action with args.
pathThe path the action is served on, without its Base.
underThe same action under base, which the page's calls put before the path.
methodThe method the action is served on.
MethodThe HTTP method an Action is served on.

Call

A Call is usable wherever a Stmt is.

ItemSummary
indicatorSets flag to true while the response is awaited and to false after.
errorSets message to the error text when the call fails, and to "" when it is sent.
latestAborts the unfinished earlier latest call to the same action.
on_errorRuns the statement handle builds when this call fails.
on_successRuns next once the server's answer has arrived and its patches are applied.
thenSends 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.

ItemSummary
StreamAction::newA stream served on GET path.
underThe same stream under base, which the page's calls put before the path.
callA call to this stream, which takes no arguments.
call_withA call to this stream with args, evaluated in the browser when the call runs.
connectedSets flag to true while the server's answer is open, and to false otherwise.
reconnectOpens the stream again when its connection fails, breaks off, or answers 5xx.