コード例 #1
0
        private void IncrementCount()
        {
            var count = _state.Count;

            count++;
            _state = new CounterState(count);
            BroadcastStateChange();
        }
コード例 #2
0
        private async Task IncrementCountAsync()
        {
            await Task.Delay(2000);

            var count = _state.Count;

            count++;
            _state = new CounterState(count);
            BroadcastStateChange();
        }
コード例 #3
0
 public CounterStore(IActionDispatcher actionDispatcher)
 {
     _state            = new CounterState(0);
     _actionDispatcher = actionDispatcher;
     _actionDispatcher.Subscribe(HandleActions);
 }