memoizeWithLimit

fun <T, R> (T) -> R.memoizeWithLimit(maxSize: Int): (T) -> R

Creates a size-limited memoized version of the receiver function.

Return

A function that caches results for previously used inputs, with a size limit.

Parameters

T

The input type for the function.

R

The output type of the function.

maxSize

The maximum number of entries to keep in the cache.