Last active
June 15, 2017 22:48
-
-
Save clarabstract/dfa94d503638815cbf40a0d6e9b21afa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let DocumentConnector = connect((state, ownProps) => { | |
| return { | |
| document: lookupDocument(state, ownProps.documentId), | |
| } | |
| }, (dispatch) => { | |
| // Note: this is actually the default behavior if mapPropsToDispatch is null | |
| // I'm just including it here for clarity | |
| return {dispatch} | |
| }, ({document}, {dispatch}, {documentId}) => { | |
| return { | |
| children: <ViewComponent document={document} />, | |
| sidebar: <Sidebar document={document} />, | |
| title: document.title, | |
| onDocumentUpdate(event) { | |
| dispatch(updateDocument(documentId, event)) | |
| }, | |
| documentId, | |
| }; | |
| }) | |
| <Route path="/document/:id" render={({id}) => <DocumentConnector(LayoutComponent) documentId={id} />} /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment