@ospfranco
Oscar Franco
3 days
Welp... as it turns out, I've been using HostObjects and NativeState all wrong. I don't even need them (for the top level db object). As long as I can capture a shared pointer in the lambdas, one can pretty much attach state to any JS object without much fuzz Doesn't make it
1
1
19

Replies

@tmikov
Tzvetan Mikov
2 days
@ospfranco That's a neat idea! You need to create separate lambdas for every object, right? Wouldn't work well for objects with tons of instances, but seems great for a top level object.
1
0
2
@ospfranco
Oscar Franco
2 days
@tmikov In this case, one can create multiple db objects but each is the root of the db operations The only case I can see I would need a HostObject/NativeState is when passing stuff around different functions/objects. Then each object needs to carry around its state Another question
1
0
3