Example #1
0
        public void AddTodo()
        {
            var action = new AddTodoAction(Description);

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