You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some actions contain information that isn't destined for the store's state. For example, an effect that calls an API to return an editable object (e.g. Customer).
As the object is mutable it should not go into state where it can be modified. Instead, allow consumers to subscribe to the dispatching of actions so they can obtain a reference to the editable object for editing without it having to be reduced into state.
An example for observing dispatched actions in a component would look something like this
protected override void OnInitialized()
{
base.OnInitialized();
Observe<GetForUpdateResultAction>(SetModel);
var getSupplierAction = new GetForUpdateAction(id: SupplierId);
Dispatcher.Dispatch(getSupplierAction);
}
private void SetModel(GetForUpdateResultAction action)
{
Model = action.Supplier;
StateHasChanged();
}
The text was updated successfully, but these errors were encountered:
mrpmorris
changed the title
Add ability for consumers to be notified of dispatched actions
RFC: Add ability for consumers to be notified of dispatched actions
Aug 7, 2020
Some actions contain information that isn't destined for the store's state. For example, an effect that calls an API to return an editable object (e.g. Customer).
As the object is mutable it should not go into state where it can be modified. Instead, allow consumers to subscribe to the dispatching of actions so they can obtain a reference to the editable object for editing without it having to be reduced into state.
An example for observing dispatched actions in a component would look something like this
Or have a base
Fluxor(some name)Component
The text was updated successfully, but these errors were encountered: