Debounce autosuggestions requests
This commit is contained in:
		
							parent
							
								
									f0bdfadab7
								
							
						
					
					
						commit
						c4eb63c1d4
					
				
					 5 changed files with 40 additions and 2 deletions
				
			
		|  | @ -2,6 +2,7 @@ import PureRenderMixin from 'react-addons-pure-render-mixin'; | |||
| import ImmutablePropTypes from 'react-immutable-proptypes'; | ||||
| import Autosuggest from 'react-autosuggest'; | ||||
| import AutosuggestAccountContainer from '../containers/autosuggest_account_container'; | ||||
| import { debounce } from 'react-decoration'; | ||||
| 
 | ||||
| const getSuggestionValue = suggestion => suggestion.value; | ||||
| 
 | ||||
|  | @ -77,6 +78,7 @@ const Search = React.createClass({ | |||
|     this.props.onClear(); | ||||
|   }, | ||||
| 
 | ||||
|   @debounce(500) | ||||
|   onSuggestionsFetchRequested ({ value }) { | ||||
|     value = value.replace('#', ''); | ||||
|     this.props.onFetch(value.trim()); | ||||
|  |  | |||
		Reference in a new issue