Closed Dekkonot closed 2 months ago
I think this is a reasonable addition. It provides an easy way to go from Ref
to UniqueId
, but it does make me consider that it's straight up impossible to go the other way around: UniqueId
to Instance
, assuming the consumer only has a UniqueId
. Maybe we should have an additional method, something like
pub fn get_by_unique_id(&self, unique_id: UniqueId) -> Option<&Instance>
Adds a method for getting the UniqueId for a given referent in a WeakDom.
Technically unnecessary but a convenience function is helpful and there's nothing stopping us from linking referents more directly to their UniqueId in the future, which this method would benefit from.