Skip to content

Instantly share code, notes, and snippets.

View ackvf's full-sized avatar
🏡
Remote Fullstack Node.js / Frontend React.js / Web3 integrations

Qwerty (Vítězslav Ackermann Ferko) ackvf

🏡
Remote Fullstack Node.js / Frontend React.js / Web3 integrations
View GitHub Profile
@ackvf
ackvf / README.md
Last active February 3, 2025 23:15
Bookmarklets and script snippets
@ackvf
ackvf / README.md
Last active November 5, 2024 20:00
TS/JS utility functions

TS/JS utility functions

other gists
🔗 TypeScript type toolbelt
🔗 React utils


  • accessTrap - Object and Array Proxy to count number of property accesses to map used/unused properties. It maintains referential stability using a caching mechanism to not disrupt React.js render flow.
@ackvf
ackvf / ComponentWithGenerics.tsx
Last active January 31, 2025 01:11
React utils
// Jan 2023
/**
* Provides better intellisense for JSX Components at call-site by allowing them to accept additional generics.
*
* In some cases it also switches `onChange` handler from `(value: string) => void` to `(event: HTMLInputEvent<..>) => void`
* to be used with `useFormState()` hook's e.g. `onInputChange` which accepts `EventStub` (`(ev: { target: { name, value }}) => void`).
*
* @example
* interface FormState {a, b}
*