Closed johnbaro closed 1 year ago
Components should only subscribe to parts of state they are interested in, not everything.
I misspoke sorry, I meant that I want to encapsulate all relevant state for a single entity (Todo) into a facade. So the interface might look like:
public interface ITodoFacade
{
void Load();
Todo Get(string id);
IState<TodoState> State { get; }
// etc..
}
Can't you also implement IStateChangedNotifier on that and FluxorComponent will pick it up?
Yes, for some reason when I looked at the code it looked like a more complex interface. Closing this I guess. Thanks.
Just to be clear.
I think if you descend your interface from IStateChangedNotifier, then FluxorComponent/FluxorLayout will detect it when it scans for injected properties and will automatically re-render when it triggers its event.
Yes, that worked perfectly thanks, 5 lines and done. Thanks again.
On Tue, 16 Aug 2022, 21:11 Peter Morris, @.***> wrote:
Just to be clear.
I think if you descend your interface from IStateChangedNotifier, then FluxorComponent/FluxorLayout will detect it when it scans for injected properties and will automatically re-render when it triggers its event.
— Reply to this email directly, view it on GitHub https://github.com/mrpmorris/Fluxor/issues/340#issuecomment-1216491016, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARZ4JES3NE7ZH6HVYADX3CLVZNZN3ANCNFSM56GWVW4A . You are receiving this because you modified the open/close state.Message ID: @.***>
I want to encapsulate all state into a Facade, including IState.
This is not possible with
FluxorComponent
as relies on anIStateChangedNotifier
member to be present.Would it be accepted if I opened a PR to support the following which would be integrated into the collection of states