Skip to content

Instantly share code, notes, and snippets.

@yonibot
Created November 18, 2019 19:27
Show Gist options
  • Select an option

  • Save yonibot/f6a763c0026eee2eeaf9fa3a4598b583 to your computer and use it in GitHub Desktop.

Select an option

Save yonibot/f6a763c0026eee2eeaf9fa3a4598b583 to your computer and use it in GitHub Desktop.
Consuming the final hook
// App.js
...
import { useWeatherService } from './useWeatherService';
const [ currentUnit, setUnit ] = useState(TEMPERATURE_UNITS.metric);
function App({coords}) {
const weather = useWeatherService(coords, currentUnit); // <- all that's left of the API logic :)
...
return (
<div className="App">
...
</div>
);
}
export default geolocated()(App);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment