Skip to content

Event Reference Dilemma  #6

@DawsonReschke

Description

@DawsonReschke

For the JSON parser to work correctly, any external libs must have an internal reference for the compiler to see, for example:

GET=async function(GETURL,POSTURL,callback){
           await axios.get(GETURL).then(val=>callback(POSTURL,GETPARSER(val),(data)=>this.LOG(this.OUTPUT_FILE,data)))
        }

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:

import axios from 'axios'
....
{
  this.axios = axios
  GET=async function(GETURL,POSTURL,callback){
           await this.axios.get(GETURL).then(val=>callback(POSTURL,GETPARSER(val),(data)=>this.LOG(this.OUTPUT_FILE,data)))
 },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions