With an indirect route, using:
const DL_assertComponentIsInGlobalDLDict = async (payLoad) => {
await dlDictQueue.push( payLoad);
return 0;
}
I can send an async event to a consumer like this from a render function:
const [dlComponentDLid] = useState(async () => await DL_assertComponentIsInGlobalDLDict( payLoad));
But what I really would like to do is not have that extra function and ‘use’ useState()
at all but call the push()
function directly, something like:
(() => {dlDictQueue.push( payLoad).then()})();
But when I try that (in various forms), the consumer receives nothing.
So, I can work around this, but I’d rather not to, This is probably me not understanding Javascript enough, but I wonder if this is something forge does to my code.