Skip to content

Mistake in intermediate guide #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ncko opened this issue Nov 10, 2020 · 1 comment
Closed

Mistake in intermediate guide #802

ncko opened this issue Nov 10, 2020 · 1 comment

Comments

@ncko
Copy link

ncko commented Nov 10, 2020

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   
  }
}
@markerikson
Copy link
Collaborator

Obsolete due to #905 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants