Struct sauron::Effects [−][src]
pub struct Effects<MSG, XMSG> {
pub local: Vec<MSG, Global>,
pub external: Vec<XMSG, Global>,
// some fields omitted
}
Expand description
Effects are a way for component to execute subsequent updates based on certain conditions. This can be used for doing animation and incremental changes to the view to provide an effect of transition or animation.
Effects contains 2 types of Messages. The local messages which will be executed in its own component on the next update loop. The other type is the external effects which are Messages that are sent to the parent Component in response to an event that has been triggerred.
Fields
local: Vec<MSG, Global>
Messages that will be executed locally in the Component
external: Vec<XMSG, Global>
effects that will be executed on the parent Component that instantiate this component
Implementations
create a new Effects with local and external expects respectively
Create an Effects with local messages that will be executed on the next update loop on this Component
Create an Effects with extern messages that will be executed on the parent Component
Map the local messages of this Effects such that MSG will be transposed into
MSG2 with the use of the mapping function f
.
The external messages stays the same.
derives an Effects which contains only local effects by transforming the external messages
and mapping them with function f
such that they can be of the same type as local effects
them merge them together into local effects.
Append this msgs to the local effects
Modify the Effect such that it will not do an update on the view when it is executed