Skip to content

Commit

Permalink
Fetch initial io.search results asynchronously if not given
Browse files Browse the repository at this point in the history
This changes behavior in that an empty search bar is never shown
anymore, we will immediately fetch data when the input renders.

Closes T-605
  • Loading branch information
jacobmischka committed Mar 3, 2023
1 parent 380c8e2 commit b9a7570
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/examples/basic/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,7 @@ const interval = new Interval({
const [r1, r2] = await io.group([
io.search('One', {
onSearch: async query => fakeDb.find(query),
initialResults: await fakeDb.find('jo'),
renderResult: result => ({
label: `${result.first_name} ${result.last_name}`,
}),
Expand Down

0 comments on commit b9a7570

Please sign in to comment.