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

Demonstrate koConnect to piggyback on identical mapStateToProps, etc. #13

Open
wants to merge 1 commit into
base: routed-email-app
Choose a base branch
from

Conversation

naw
Copy link
Owner

@naw naw commented Dec 8, 2015

No description provided.

@@ -21,3 +21,5 @@ export default function configureStore(initialState) {

return store
}

export default configureStore();
Copy link
Collaborator

Choose a reason for hiding this comment

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

what's the purpose of exporting the called configureStore function here rather than just calling it where it's imported?

Copy link
Owner Author

Choose a reason for hiding this comment

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

For the KO example, the call to koConnect needed access to the store because there wasn't a top-level <Provider> component passing it around in context.

So, the call to koConnect either needed to be in the same file that configureStore() is called in (i.e. index.js previously), or we needed to put the result of calling configureStore in a place that was importable in multiple files (in this case, index.js and components/Email.js).

If we were actually building a Knockout-Redux app, we could probably do something like <Provider> and pass around a context to child view models like react-redux does, but for purposes of this example, it wasn't really important.

Copy link
Collaborator

Choose a reason for hiding this comment

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

ah gotcha

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