Cameron Fletcher
1 min readJul 5, 2017

--

I believe this might be because of the layer of indirection introduced in the computed todos property. Under the hood, mobdux is checking whether anything coming out of the mapStoresToProps function is an ObservableArray and doing the enumeration for you (so you don’t have to). If you try the following does it work?

// todos_store.js
export default class Todos {
@observable todos = ['hello there'];
@action insertTodo(todo = 'str') { this.todos.push(todo); }
}
// todos_container.js
import { connect } from 'mobdux';
import TodosDumb from '../components/todos_dumb.jsx';

export default connect(
stores => {
return {
todos: stores.todoStore.todos,
insertTodo: (todo) => stores.todoStore.insertTodo(todo)
};
}
)(TodoDump);

--

--