Represent maps
// rather than
const map: {[ key: string ]: string} = {
foo: 'bar',
}
// gitignore this file | |
module.exports = { | |
HASURA_URL: 'https://myapp.herokuapp.com/v1/graphql', | |
HASURA_ADMIN_SECRET: 'xxx', | |
}; |
/** | |
* useScroll React custom hook | |
* Usage: | |
* const { scrollX, scrollY, scrollDirection } = useScroll(); | |
*/ | |
import { useState, useEffect } from "react"; | |
export function useScroll() { | |
const [lastScrollTop, setLastScrollTop] = useState(0); |