liveBook · Manning

Action

As explained in Refactoring to Rust

An action is an event or command describing a state transition that a component should process.

An action is an event or command that a component processes to change state or start work. In Yew, actions are represented by the component's Message type and handled by update. section 9.5

Actions in a paginated list

A list component can define IncrementPage, SetFeedState, and GetSearch actions. Clicking “More” sends IncrementPage; update advances the page and sends GetSearch. The asynchronous search then produces SetFeedState with either successful or failed data. section 9.5

How Refactoring to Rust covers it

How deep it goes
Defines actions as enums and traces their handling through update, stopping short of broader action-system design.
Examples
Uses pagination, feed-fetch states, button callbacks, and asynchronous search results as concrete action examples.
What you can do after
Build it from scratch by defining message variants and implementing update logic for component events and asynchronous results.
How it connects
Connects actions with component state, messages, Model-View-Controller, asynchronous work, and view rendering.

Also explained in

Compare how 13 books explain action →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Refactoring to Rust. The section links point to the parts of the book it draws on.