Skip to content

Commit

Permalink
Update the example to support remote actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus committed Aug 1, 2016
1 parent c4cfda3 commit c457c75
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/simple-todo/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ var todoFactory = function (title) {
var todoListFactory = function () {
var todoList = {
addTodo: mobx.action(function addTodo (todo) {
todoList.todos.push(todo);
todoList.todos.push(todoFactory(todo));
}),
addTodos: mobx.action(function addTodos (todos) {
todoList.todos = todoList.todos.concat(todos);
todoList.todos = todoList.todos.concat(todos.map(todo => todoFactory(todo)));
})
};

Expand Down Expand Up @@ -83,5 +83,5 @@ ReactDOM.render(
document.getElementById('root')
);

store.addTodos([todoFactory('Get Coffee'), todoFactory('Write simpler code')]);
store.addTodos(['Get Coffee', 'Write simpler code']);
store.todos[0].toggleStatus(true);

0 comments on commit c457c75

Please sign in to comment.