Language is TypeScript (didn't have a specific category).
Say I have a object hierarchy like so:
Is there some clever way of allowing "instance_i d" to be accessible to the lower objects without passing them through functions down the hierarchy and such?
Cant store as static (objects are from classes) due to multiple instances of this object.
Would really appreciate some ideas on this. Thanks in advance.
Say I have a object hierarchy like so:
Code:
let obj = {
instance_id: "<some uuid>"
child1:
{
child2:
{
function log() => console.log(instance_id);
}
}
}
Cant store as static (objects are from classes) due to multiple instances of this object.
Would really appreciate some ideas on this. Thanks in advance.
Comment