fileoverview author Yosuke Ota
  import type { LoadData } from './cache-loader' ; import { CacheLoader } from './cache-loader' ; /**
 * This function returns a function that returns the result value that was called for the given function.
 * But when called, it returns the cached value if it is the same as the previous argument.
 */ export function defineCacheFunction < A extends any [ ] , R > ( fn ) { const loader = new CacheLoader ( fn , Infinity ) ; return ( ... args ) => { return loader . get ( ... args ) ; } ; }