Skip to content
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

Merged
merged 1 commit into from
Jul 8, 2016
Merged

Conversation

timwis
Copy link
Member

@timwis timwis commented Jul 8, 2016

The current docs use myTodos in the code but todos in the narrative. This PR makes the narrative match the code and uses todos and items to differentiate between the namespace and the array in the state.

@yoshuawuyts
Copy link
Member

Oh yeah, lgtm!

@timwis timwis merged commit 5fc2cab into choojs:master Jul 8, 2016
@timwis timwis deleted the docs-model-namespace branch July 8, 2016 10:13
reducers: {
add: (data, state) => ({ todos: state.todos.concat(data.payload) })
add: (data, state) => ({ todos: state.items.concat(data.payload) })
Copy link

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) }).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yikes! Good catch

Copy link
Member Author

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

Copy link
Member

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 ✨

Copy link
Member Author

@timwis timwis Jul 10, 2016

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

timwis added a commit that referenced this pull request Jul 10, 2016
timwis added a commit that referenced this pull request Jul 10, 2016
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

Successfully merging this pull request may close these issues.

3 participants