private void IncrementCount() { var count = _state.Count; count++; _state = new CounterState(count); BroadcastStateChange(); }
private async Task IncrementCountAsync() { await Task.Delay(2000); var count = _state.Count; count++; _state = new CounterState(count); BroadcastStateChange(); }
public CounterStore(IActionDispatcher actionDispatcher) { _state = new CounterState(0); _actionDispatcher = actionDispatcher; _actionDispatcher.Subscribe(HandleActions); }