A Yew message is a value representing an action that a component processes in its update operation. Declare message variants as an enum, associate that enum with the component, and match each received value to a state change, event, or asynchronous request. section 9.5
Message
A Yew message is a value representing an action that can be processed by a component update operation.
How Refactoring to Rust covers it
- How deep it goes
- Defines message variants and demonstrates matching, state mutation, rerender signaling, and asynchronous follow-up requests.
- Examples
- Uses pagination, feed-fetch states, a More button, and search results to demonstrate message-driven updates.
- What you can do after
- Apply it via Yew's Component trait to model actions and update component state in response to events or requests.
- How it connects
- Connects messages to Yew components, component state, view rendering, event callbacks, and asynchronous operations.
Related concepts
- actionkind of · An action is a choice or operation selected or performed by an actor that can affect a system or environment or produce an outcome.
- messagekind of · A message is a discrete unit of information or data represented, processed, or exchanged in a communication context.
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.
