Everyone loves type-safe APIs nowadays, but as far as I can tell query parameters are a blind spot to most people right now.
I create a hook which uses a builder pattern a while ago, which allows you to create type-safe query parameters. It is not very polished and contains some specific use cases, that's why I hesitated to share it. But as I successfully use it for a couple of month already and (afaik) no one came up with something similar so far, I wanted to share it.
How does it look like?
import * as pp from './page-params';
type FavoriteFood = 'pizza' | 'noodles' | 'wraps' | 'hot-dogs';