Skip to content

Commit 056dc73

Browse files
committed
Use searcher factory
1 parent 0fe11fa commit 056dc73

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/views/PopularRepositories.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@
1111
</template>
1212

1313
<script>
14+
import Searcher from "./../util/searcher";
1415
import { mapGetters } from "vuex";
15-
import * as JsSearch from "js-search";
1616
import sortBy from "lodash/sortBy";
1717
import Repositories from "@/components/RepositoryCard";
1818
import InputSearch from "@/components/InputSearch";
19-
const searcher = new JsSearch.Search("position");
20-
searcher.indexStrategy = new JsSearch.AllSubstringsIndexStrategy();
21-
searcher.searchIndex = new JsSearch.UnorderedSearchIndex();
22-
searcher.addIndex("name");
23-
searcher.addIndex("description");
19+
20+
const searcher = new Searcher("position").addIndex("name").addIndex("description");
2421
2522
export default {
2623
name: "PopularRepositories",

0 commit comments

Comments
 (0)