Call as
Functions.cache.getRetryCached(cache, func, ...)
Record it as a dependency named Functions.cache.getRetryCached (accepting the completion does this), then call it by that name.
Also accepted under the former namespace utils.
What it does
Cache an observation after it returns a non-nil value; retry observations whose entire return tuple is nil. Uses the same exact argument keys as getCached.
Arguments
| Name | Type | What it does |
|---|---|---|
cache | table | nil | Evaluation cache, or nil to bypass caching. |
func | function | string | Function or global function name to call. |
... | any | Arguments forwarded unchanged to the observed function. |
Returns
| 1 | ... | All original results, preserving nil positions and return count. |
|---|
Editions
Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.
It reads no game API directly.
Example
local name = Functions.cache.getRetryCached(cache, GetSpellInfo, 774)
return name ~= nilDependencies
getCachedInternal→utils.getCachedInternal
Source
Functions/cache.lua, line 173. Read only in game; Duplicate makes an editable copy.
Functions.cache.getRetryCached(cache, func, ...)
return getCachedInternal(cache, false, func, ...)