コード例 #1
0
        private static IStore CreateStore()
        {
            IStore store = new Store.Store(
                // Loads up the instance of the Store with the last known State.
                // In this example a new state is always being created, but that's
                // the place where you should load your current State from disk
                // or whatever you prefer for persisting data.
                InitialState.Create(),

                // Register all Reducers that should be applied to dispatched
                // actions.
                RootReducer.Create()
                );

            store.Subscribe(SubscriptionType <AppState> .NewStateSubscription(state =>
            {
                // The State was updated. That's the moment where you
                // should persist the current state.
            }));

            return(store);
        }