Live hooks – simple missing patterns for predictable hooks in async React code
2 points
1 hour ago
| 1 comment
| github.com
| HN
taldavidson
1 hour ago
[-]
Custom React hooks compose beautifully in sync code and quietly break across await - the hook result you captured goes stale, and reads and method calls on it silently refer to an older render. live-hooks is three small primitives that close the gap: hook results, callbacks, and debounced functions that always dispatch to the latest render. BSD-3, React, React Native.
reply