MiniStateCombined is a utility class that enables aggregating multiple MiniState instances, giving you a unified way to track and display loading states, error messages, and success messages across related operations.
Key Use Case: When your component performs multiple related operations (like load user details, update user, delete user), MiniStateCombined lets you show a single loading spinner, error message, or success message that represents the combined state of all operations.
Creates a combined state object that aggregates the state of multiple MiniState instances. The combined state provides signals and observables that reflect the collective state of all the input states.
Creates a signal that is true if any of the input states are currently loading. This is useful for showing a single loading indicator for multiple operations.
Creates a signal that contains the most recent error message from any of the input states. Only one error message is displayed at a time, prioritizing the most recent.
Creates a signal that contains the most recent success message from any of the input states. Only one success message is displayed at a time, prioritizing the most recent.
Creates a signal that contains the most recent data from any of the input states. This is useful when multiple operations affect the same data model.
Creates a signal that contains the most recent error object from any of the input states. This provides access to the actual error object for custom error handling.
The following example demonstrates a complete user profile component using MiniStateCombined to coordinate multiple user operations: