Cache

cache.replace

Replaces the cached registry reference for one instance with another instance reference.

Syntax

cache.replace(source: Instance, replacement: Instance)

Arguments

NameTypeDescription
sourceInstanceThe instance whose reference is to be replaced.
replacementInstanceThe replacement value for the instance's reference.

Description

Replaces the cached registry reference for one instance with another instance reference.

Call it with 2 parameter(s): source, replacement. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Example call with placeholder values.

cache.replace(game, game)