public void AddTodo() { var action = new AddTodoAction(Description); Dispatcher.Dispatch(action); this.Description = string.Empty; }
private void AddAction(AddTodoAction action) { _todoCollection.Insert(new TodoItem { Id = action.Id, Text = action.Text }); }
public static ImmutableArray <Todo> AddTodoReducer(ImmutableArray <Todo> previousState, AddTodoAction action) { return(previousState.Insert(0, new Todo( text: action.Text, isCompleted: false, id: Guid.NewGuid() ))); }
private static ImmutableArray <TodoItem> AddTodoReducer(ImmutableArray <TodoItem> previousState, AddTodoAction action) { return(previousState .Insert(0, new TodoItem { Id = action.Id, Text = action.Text })); }
public static ImmutableArray <Todo> AddTodoReducer(ImmutableArray <Todo> previousState, AddTodoAction action) { return(previousState .Insert(0, new Todo { Id = Guid.NewGuid(), Text = action.Text })); }
public static ImmutableArray <Todo> AddTodoReducer(ImmutableArray <Todo> previousState, AddTodoAction action) { return(previousState.Insert(0, new Todo(action.Text))); }