コード例 #1
0
ファイル: App.xaml.cs プロジェクト: win-wo/redux.NET
        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);
        }
コード例 #2
0
 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)
     };
 }