Last active
August 31, 2015 04:06
-
-
Save garrytan/bc00d8146c96473a7e52 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
| @ExampleComponent = React.createClass | |
| mixins: [HistoryJSMixin] | |
| # so, in your search field, you can save the state to history and set the URL as well below... | |
| # | |
| search: (toSearch)-> | |
| handleResults = (err, content)=> | |
| if content.query == @state.search | |
| @setState(searchResults: content.hits) | |
| @saveState(url: '/foo?bar=foo') # BINGO | |
| # hypothetical search function async call../ | |
| @index.search toSearch, {}, handleResults |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment