public App() { InitializeComponent(); var initialState = new ApplicationState { Todos = ImmutableArray<Todo>.Empty, Filter = TodosFilter.All }; //Store = new Store<ApplicationState>(initialState, ApplicationReducer.Execute); Store = new TimeMachineStore<ApplicationState>(initialState, ApplicationReducer.Execute); }
public static ApplicationState Execute(ApplicationState previousState, IAction action) { return new ApplicationState { Filter = action is FilterTodosAction ? ((FilterTodosAction)action).Filter : previousState.Filter, Todos = TodosReducer(previousState.Todos, action) }; }