-
-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Update "Usage with React" #1285
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
Conversation
cc @omnidan who owns |
I will go for the first bullet point: basics/ExampleTodoList.md |
To make it super clear, the new "Usage with React" is here: |
@gaearon @pedrottimark Perhaps this can be helpful. It is the source code used for the update to Usage with React. I didn't include tests, otherwise the code is complete. |
@urbanvikingr Do you think it would be more efficient and less risk of error for you to do it? No offense taken, if you have time and want to. |
Note there were mixed code styles in previous PR. I tried to amend those to match our code style enforced by the linter. |
@gaearon So the goal is on ___react-docs-update branch: copy each chunk of code from UsageWithReact.md paste it where it goes in the order of ExampleTodoList.md but leave all other code there which is not in the intersection unchanged (for example, Action Creators and Constants). |
@gaearon Hopefully the Pooh Bear brain of a hybrid writer-designer-developer doesn’t drive you crazy.
|
For the rest of the code, use code from https://github.com/urbanvikingr/todo/. It's based on my Egghead tutorials.
I agree order should be consistent. We should strive to maintain “first declared, then used” order. So |
Yes, order everywhere should be consistent. Thanks for helping! |
@gaearon Thank you as always for your patience to explain. Super, I will use “first declared, then used” order as the guiding principle when there is an inconsistency. Am keeping notes as other little things come up to ask as a batch tomorrow. |
👍 |
I gave you the commit bit so please feel free to edit the branch right as part of this PR. I'd like if you could flush your temporary progress so we have some shared bits others could use for the rest of the bullet points. |
@pedrottimark I can update source code for ToDo this weekend. |
I'll take the second bullet: recipes/ComputingDerivedData.md |
@jakegardner Thank you! |
I'd imagine something like this: (pardon the renames) import { getVisibleTodos } from '../selectors'
const mapStateToProps = (state) => {
return {
todos: getVisibleTodos(state)
}
}
...
const VisibleTodoList = connect(
mapStateToProps,
mapDispatchToProps
)(TodoList) I don't see the value in *selector suffix. |
I agree terse names are better, but then it would be the same as the non-memoized version. What do you suggest? Maybe I'm missing something. The output of createSelector() is a function that returns the memoized state. In the previous version of this document, that output was mapped as props to the child components of App. Now that we're doing the filtering in VisibleTodoList without a render method, I'm not sure how to map the output of createSelector() (via visibleTodosSelector) to child props. |
Doesn't my example show how? Call selector from mapStateToProps. I think :-) |
Ok, I was trying to not modify the selector definition. But as you wish :-) Have a look: #1295 |
Update todoStore to store.
Found a bug #1332 |
Update todoStore to store.
@gaearon I suggest that I rename |
The problem is that todomvc has more "stuff" than todos-with-undo. But I agree it's weird they are so different. Do as you think is best, and I'll take a look later! |
OK, I'm going to rename |
Decided to keep the |
@urbanvikingr Where can I find the latest version you were working on? |
Bug in "Usage With React" and "Example Todo List" docs
@urbanvikingr I’ll take care of merge conflicts, thanks. Let me take some time and I’ll merge |
@gaearon Awesome. Thanks. Then |
Update ComputingDerivedData.md [WIP]
Thanks to everyone involved! This is up: http://redux.js.org/docs/basics/UsageWithReact.html |
This builds on top of #1186 with some changes I wanted to make to the wording and structure. "Usage with React" looks done to me (although improvements are welcome!)
Right now I really want somebody to contribute a few things here:
Update https://github.com/rackt/redux/blob/___react-docs-update/docs/basics/ExampleTodoList.md to match the source code from the new "Usage with React"Update https://github.com/rackt/redux/blob/___react-docs-update/docs/recipes/ComputingDerivedData.md to match the new example (should be just a few tweaks, e.g. it should feature VisibleTodoList rather than App component)Update https://github.com/rackt/redux/tree/___react-docs-update/examples/todos-with-undo to also match that source code (except for the undo part, obviously)Update https://github.com/rackt/redux/blob/___react-docs-update/docs/recipes/ImplementingUndoHistory.md to match the newtodos-with-undo
exampleHelp greatly appreciated because I'm busy but I really really want to ship this.
Please post in this thread if you'd like to take some part of this work.