-
Notifications
You must be signed in to change notification settings - Fork 596
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
Correct model namespace example #143
Conversation
Oh yeah, lgtm! |
reducers: { | ||
add: (data, state) => ({ todos: state.todos.concat(data.payload) }) | ||
add: (data, state) => ({ todos: state.items.concat(data.payload) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the key of the returned object the namespace?
I'd expect it to be the new state, so instead of ({ todos: state.items.concat(data.payload) })
I'd thought it would be ({ items: state.items.concat(data.payload) })
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes! Good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yoshuawuyts I can try to work some git ninjitsu and amend the commit and push to master
, or create another pull request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather we not force push to master; might even disable that from settings - feel free to just push a new commit tho, it's just docs and the fix is straight forward so no need to run CI ✨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgot that would require a force push, thx. posted PR
The current docs use
myTodos
in the code buttodos
in the narrative. This PR makes the narrative match the code and usestodos
anditems
to differentiate between the namespace and the array in the state.