Skip to content

Mistake in intermediate guide #802

Closed
@ncko

Description

@ncko

https://redux-toolkit.js.org/tutorials/intermediate-tutorial

...I prefer always having payload be an object, so I made it action.payload.id instead

However, the actual code snippet this is referring to does not use action.payload.id It uses action.payload directly:

toggleTodo(state, action) {
  const todo = state.find(todo => todo.id === action.payload)
  if (todo) {
    todo.completed = !todo.completed   
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions