-
Notifications
You must be signed in to change notification settings - Fork 13
/
trie-tree.html
34 lines (32 loc) · 870 Bytes
/
trie-tree.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head></head>
<body>
<input type="text" id="search" />
<script>
// const identify = ["login", "uuid"];
const identify = "id";
const excludedKeys = [];
const root = new Leaf();
let tree = null;
fetch("https://randomuser.me/api/")
// fetch("https://randomuser.me/api/?results=1000")
.then(response => {
return response.json();
})
.then(formattedResponse => {
const { results } = formattedResponse;
tree = new SearchTrieTree({
identify: ["login", "uuid"],
data: results
});
tree.show();
})
.catch(error => {
console.log(error);
});
document.querySelector("#search").oninput = event => {
const value = event.target.value;
};
</script>
</body>
</html>