예제 #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);
 }