MJMarcel Jackwerthinblog.mrcljx.dev·Aug 29, 2023 · 3 min readNYC Tip: Sleep No MoreWhile I had a short layover in New York last spring, I finally got to visit properly this year. During my trip planning, I reached out to Orta who had lived in NYC for a while. While he gave me a wonderful list of things to eat, visit, and do, one it...00
MJMarcel Jackwerthinblog.mrcljx.dev·Jan 26, 2023 · 1 min readExhaustive Checks with MypyIf you want to exhaustively check an enum (or a literal) and have Mypy tell you when you forgot a case, you can write yourself a tiny utility function: from typing import NoReturn def unreachable(v: NoReturn) -> NoReturn: raise AssertionError() ...00
MJMarcel Jackwerthinblog.mrcljx.dev·Aug 26, 2022 · 5 min readThe useEvent Hook for ReactDan Abramov has opened an RFC proposing the addition of a useEvent hook to React. It's meant to allow for this change in your codebase: - const onClick = useCallback(() => console.log("Hello", name), [name]); + const onClick = useEvent(() => console....00
MJMarcel Jackwerthinblog.mrcljx.dev·Aug 10, 2022 · 3 min readAbout React KeysThis is mostly a rephrased version of React's official documentation on Lists and Keys with some additional examples. React allows specifying a key property on a component. It lets React identify components and track their identities. Iterating over ...00