The WeakRef object lets you hold a weak reference to another object, without preventing that object from getting garbage-collected. Documentation WeakRef by Mozilla Contributors, licensed under CC-BY-SA 2.5.

Constructor

new(target:T)

Creates a new WeakRef object.

Methods

deref():Null<T>

Returns the WeakRef object's target object, or null if the target object has been reclaimed.