Skip to content

Commit

Permalink
remove top-level await
Browse files Browse the repository at this point in the history
  • Loading branch information
Sansui233 committed Nov 13, 2024
1 parent c0a9a19 commit ffca268
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/use-search.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import React, { useCallback, useState } from 'react'
import { Naive, Result, SearchObj } from './search'

const createNaive = await (import("./search").then(mod => mod.createNaive))

export type SearchStatus = {
isSearch: "ready" | "searching" | "done",
searchText: string,
Expand Down Expand Up @@ -78,7 +76,7 @@ function useSearch<R>({ inputRef, setRes, initData }: Props<R>): {
)
}

newEngine = createNaive({
newEngine = (await import("./search")).createNaive({
data: searchObj,
field: ["tags", "content"],
notifier,
Expand Down

0 comments on commit ffca268

Please sign in to comment.