benjamn / optimism

Composable reactive caching with efficient invalidation.
MIT License
114 stars 19 forks source link

Improve types to reflect key-making functions may return `undefined` #627

Closed benjamn closed 11 months ago

benjamn commented 11 months ago

Returning undefined from makeCacheKey is the recommended technique for efficiently opting out of caching for particular combinations of input arguments, so that possibility should be reflected in the TypeScript types for the various functions that handle keys.