mendix / AppStoreWidgetBoilerplate

A boilerplate for creating a brand new Widget for Mendix 5.6.0 and up
Apache License 2.0
19 stars 20 forks source link

Use of undocumented Mendix API #45

Closed Andries-Smit closed 7 years ago

Andries-Smit commented 8 years ago

Dear Mendix,

The API Documentation does not describe the use of the nullExec function of the boilerplate https://github.com/mendix/AppStoreWidgetBoilerplate/blob/master/src/WidgetName/widget/WidgetName.js#L180

// The callback, coming from update, needs to be executed, to let the page know it finished rendering
mendix.lang.nullExec(callback);

It should be updated in the documentation https://apidocs.mendix.com/6/client/module-mendix_lang.html

We have also noted that the code is:

mendix.lang.nullExec = function(callback) {
        callback && callback();
};

This bit of code is tries to execute a parameter even if it is not of the type function. It would be better to check if for it.

mendix.lang.nullExec = function(callback) {
     if (typeof callback === "function") {
           callback();
     } else {
          console.warn("nullExec should have a function as argument")
     }
};
JelteMX commented 7 years ago

The function has been replaced, because it will be considered (still works) deprecated in Mendix 7. The use of undocumented APIs is strongly discouraged.