diff --git a/spikes/fuzzy-search/react-select/src/search-async.js b/spikes/fuzzy-search/react-select/src/search-async.js index c8f9ace5..44b8fc7f 100644 --- a/spikes/fuzzy-search/react-select/src/search-async.js +++ b/spikes/fuzzy-search/react-select/src/search-async.js @@ -1,10 +1,6 @@ const React = require('react'); const Select = require('react-select'); -const { - Async -} = Select - -const SelectAsync = Async +const SelectAsync = Select.Async const SearchAsync = React.createClass({ @@ -22,36 +18,35 @@ const SearchAsync = React.createClass({ }); }, - render: function () { + options: function(input, callback) { + setTimeout(function() { + callback(null, { + options: [ + { value: 'one', label: 'One' }, + { value: 'two', label: 'Two' }, + { value: 'three', label: 'Three' }, + { value: 'four', label: 'Four' }, + { value: 'five', label: 'Five' }, + { value: 'six', label: 'Six' }, + ], + // CAREFUL! Only set this to true when there are no more options, + // or more specific queries will not be sent to the server. + complete: true + }, 10000); + }); + }, - const options = function(input, callback) { - setTimeout(function() { - callback(null, { - options: [ - { value: 'one', label: 'One' }, - { value: 'two', label: 'Two' }, - { value: 'three', label: 'Three' }, - { value: 'four', label: 'Four' }, - { value: 'five', label: 'Five' }, - { value: 'six', label: 'Six' }, - ], - // CAREFUL! Only set this to true when there are no more options, - // or more specific queries will not be sent to the server. - complete: true - }, 1000); - }); - } + render: function () { return (

Async Search

) diff --git a/spikes/fuzzy-search/react-select/src/search.js b/spikes/fuzzy-search/react-select/src/search.js index 2ef454bf..4be4f4a9 100644 --- a/spikes/fuzzy-search/react-select/src/search.js +++ b/spikes/fuzzy-search/react-select/src/search.js @@ -33,6 +33,7 @@ const Search = React.createClass({

{this.props.multi ? 'Multi' : 'Single'} Search