This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # | |
| # git-mv-with-history -- move/rename file or folder, with history. | |
| # | |
| # Moving a file in git doesn't track history, so the purpose of this | |
| # utility is best explained from the kernel wiki: | |
| # | |
| # Git has a rename command git mv, but that is just for convenience. | |
| # The effect is indistinguishable from removing the file and adding another | |
| # with different name and the same content. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/App.js b/src/App.js | |
| index b6ab68e..eef86a1 100644 | |
| --- a/src/App.js | |
| +++ b/src/App.js | |
| @@ -1,7 +1,14 @@ | |
| import React, { useState } from "react"; | |
| import { BehaviorSubject } from "rxjs"; | |
| import { getCityDetails } from "./xhr"; | |
| +import { | |
| + filter, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/App.js b/src/App.js | |
| index 274e962..b6ab68e 100644 | |
| --- a/src/App.js | |
| +++ b/src/App.js | |
| @@ -1,25 +1,21 @@ | |
| -import React, { useState, useEffect } from "react"; | |
| +import React, { useState } from "react"; | |
| import { BehaviorSubject } from "rxjs"; | |
| import { getCityDetails } from "./xhr"; | |
| import "./styles.css"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/hooks.js b/src/hooks.js | |
| index 1cbeb9f..568140f 100644 | |
| --- a/src/hooks.js | |
| +++ b/src/hooks.js | |
| @@ -1,17 +1,9 @@ | |
| -import { useEffect, useState } from "react"; | |
| -import { debounce } from "lodash"; | |
| -import { DEBOUNCE_MS } from "./constants"; | |
| +import { useEffect } from "react"; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/src/App.js b/src/App.js | |
| index 720cea8..274e962 100644 | |
| --- a/src/App.js | |
| +++ b/src/App.js | |
| @@ -1,8 +1,11 @@ | |
| import React, { useState, useEffect } from "react"; | |
| +import { BehaviorSubject } from "rxjs"; | |
| import { getCityDetails } from "./xhr"; | |
| import "./styles.css"; | |
| import { useDebounce } from "./hooks"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React, { useState, useEffect } from "react"; | |
| import { getCityDetails } from "./xhr"; | |
| import "./styles.css"; | |
| import { useDebounce } from "./hooks"; | |
| export default function App() { | |
| const [searchText, setSearchText] = useState(""); | |
| const debouncedSearchText = useDebounce(searchText); | |
| const [details, setDetails] = useState({}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export const getCityDetails = async (city) => | |
| fetch( | |
| `https://api.teleport.org/api/cities/?search=${city}` | |
| ).then((response) => response.json()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useEffect, useState } from "react"; | |
| import { debounce } from "lodash"; | |
| import { DEBOUNCE_MS } from "./constants"; | |
| export const useDebounce = (searchTerm, delay = DEBOUNCE_MS) => { | |
| const [debouncedValue, setDebouncedValue] = useState(searchTerm); | |
| const debouncedHandler = debounce(() => { | |
| setDebouncedValue(searchTerm); | |
| }, delay); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/voronoi-graph.js b/voronoi-graph.js | |
| index ab86854..0dfd584 100644 | |
| --- a/voronoi-graph.js | |
| +++ b/voronoi-graph.js | |
| @@ -42,12 +42,18 @@ lines.selectAll("circle-group") | |
| .style("fill", (d,i) => d.color) | |
| .style('stroke-width', 2) | |
| .style('opacity', 1) | |
| - .on("mouseover", function(d) { | |
| - div.transition().duration(200).style("opacity", .9); |
NewerOlder