Blog
2025
- Find and Replace with Regex Groups in VS CodeI sometimes need to search and replace across some code, but with parts of the search left untouched. Every time, I forget how to do it in VS Code.
- Handling Complex React State with usePatchedStateusePatchedState is a nice hook to simplify complex state management in React with TypeScript. Instead of many indivual, atomic useState calls, you define your initial state and then get a “patch” function that you use to edit parts of the state granularly.
- Custom Prettier Options for Markdown Code BlocksA Prettier feature that I love is that it formats files, but also code blocks in Markdown files. I wanted to customize the maximum line length and the tab size for the code in my articles, but not have the same option applied to the rest of my codebase.
- Propagating Errors with Redux ToolkitI recently started migrating my company’s codebase to Redux Toolkit, after many years using bare Redux with manually (painfully) written action creators and reducers. After some time, I realized that our error handling code was malfunctioning for async thunks.