You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example the GET function is making a reference to axios an external library for http requests. Since the JSON converter does not have a reference to this library it cannot compile. This happens because when instanciating a new function with the function constructor, the function is evaluated and has no reference to the external library. To void this, you must have a reference to the requested library in the prototype of the Event, and when you need the library use the prototypes reference to it. Example:
If not obvious, the reason this is a problem is that if the programmer is not careful, each Event object could have its own reference to a specific library that they ALL use. axios is bad example for this because each Event already had a global reference to the module. One way to get around this would be to create a class that extends the current Event class that adds in references to all of the required modules.
For the JSON parser to work correctly, any external libs must have an internal reference for the compiler to see, for example:
In this example the GET function is making a reference to axios an external library for http requests. Since the JSON converter does not have a reference to this library it cannot compile. This happens because when instanciating a new function with the function constructor, the function is evaluated and has no reference to the external library. To void this, you must have a reference to the requested library in the prototype of the Event, and when you need the library use the prototypes reference to it. Example:
The text was updated successfully, but these errors were encountered: