Let’s say I have 2 Javascript resources - Alpha
and Beta
(Alpha
loads first, then Beta
…)
Beta
has a Class in it - let’s call it BetaClass
I want Alpha
to have an instance of BetaClass
.
Surely that’s simple right?
The docs say need to use the export
system provided to reference functions from other resources.
However it seems I appear to only be able to export single functions, not classes.
Is this the case?
If so… that is virtually useless! How am I supposed to make child-resources at all if I can’t extend via Classes? I’ve even tried scrapping classes all together and making the export
point to a function whch returns a class-like object, but for some reason the FiveM framework totally ignores functions within that object. Why??
Can I make an object in the Alpha resource using code from the Beta resource?