AOAnthony Oyathelemhiinblog.frontendtony.com·Nov 14, 2021 · 2 min readAdd Auto-logout To A React AppTL;DR const logoutTimerIdRef = useRef(null); useEffect(() => { const autoLogout = () => { if (document.visibilityState === 'hidden') { const timeOutId = window.setTimeout(logoutUser, 5 * 60 * 1000); logoutTimerIdRef.current = timeO...00
AOAnthony Oyathelemhiinblog.frontendtony.com·Aug 30, 2021 · 4 min readThe Basics: JavaScript Addition Operator (+)One of the uses of the plus (+) symbol in JavaScript is to perform addition of two values. It can either perform numeric addition, as you'd expect, but also string concatenation. This is pretty standard in most programming languages. Let's take a bri...00
AOAnthony Oyathelemhiinblog.frontendtony.com·Aug 23, 2021 · 2 min readThe Little Known CSS UnitAs a Frontend Developer, it is sometimes humbling to know just how much you don't know about the basic building blocks of the web. The amount of tools and techniques available to us is A LOT! So it's no surprise we often just pick whatever solves our...02EA
AOAnthony Oyathelemhiinblog.frontendtony.com·Aug 15, 2021 · 2 min readHow to preload pages with NextjsThere are two next-specific ways you can navigate between pages in a Nextjs application (on the client side) Using the component from next/link (declarative) Using the router object from the useRouter hook (imperative) We're going to look at prefe...00