code: function createTodo(state: State, text: ?string): State {
    if (!text) {
      return state;
    }
    var newTodo = new Todo(text);
    return state.set(newTodo.id, newTodo);
  }
docs: Pure helper function to create a new Todo and add it to the state.