WLJS LogoWLJS Notebook

FrontEndExecutable

Frontend symbol
FrontEndExecutable[uid_String]

A static reference to a frontend object (see CreateFrontEndObject) like FrontEndRef, but can only be executed on the frontend (WLJS Interpreter).

Application

Custom WLJS function

Use for custom defined WLJS functions i.e.

.js
core.MyCustomStuff = async (args, env) => {
	env.element.innerText = "Hi dude!";
}

and then in the next cell

CreateFrontEndObject[MyCustomStuff[]]

Use TagSetDelayed on MakeBoxes to apply it automatically, i.e.

MyCustomStuff /: MakeBoxes[m_MyCustomStuff, StandardForm] := With[{
	o = CreateFrontEndObject[m]
},
	MakeBoxes[m, StandardForm]
]

then you don't need to manually create a frontend object anymore. Or even better - if your expression is not large one can bypass frontend objects at all

MyCustomStuff /: MakeBoxes[m_MyCustomStuff, StandardForm] := ViewBox[m,m]

On this page