async functions cannot be added to dat.gui
saviski opened this issue · comments
dat.gui/src/dat/utils/common.js
Line 152 in 743a16b
async functions returns "[object AsyncFunction]"
This code fails:
let obj = {
async f() {}
};
gui.add(obj, 'f');
Thanks! Want to open a PR changing this to obj instanceof Function
, or similar?
Pull request #241 fixes this, though I used typeof obj === "function"
.
It also returns the ability to provide button text for your FunctionController
:
gui.add( obj, property, 'Click Me!' );
Finally it fixes a double-firing click-event issue unmasked by the returned button text.
( Maybe that's why someone set button text to an empty string in ControllerFactory
? )
I left the default button text of 'Fire'
in place.... but its been blank so long maybe it should default to no text?