Reference › Function reference › Functions

Functions.cache.getRetryCached

public

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

NameTypeWhat it does
cachetable | nilEvaluation cache, or nil to bypass caching.
funcfunction | stringFunction or global function name to call.
...anyArguments 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 ~= nil

Dependencies

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, ...)

Back to Function reference