Methods
(static) withCache(key, defaultSupplier) → {any}
将 defaultSupplier 返回的数据以 key 为键缓存,并返回数据。
Parameters:
| Name | Type | Description |
|---|---|---|
key | any | 缓存的键。 |
defaultSupplier | function | 返回默认数据的函数。 |
- Source
Returns:
缓存数据。
- Type:
- any
(async, static) withCacheAsync(key, defaultSupplier) → {any}
将 defaultSupplier 返回的数据以 key 为键缓存,并返回数据。
Parameters:
| Name | Type | Description |
|---|---|---|
key | any | 缓存的键。 |
defaultSupplier | function | 返回默认数据的异步函数。 |
- Source
Returns:
缓存数据。
- Type:
- any