Main-Thread Scripts
Touch handlers that restyle an element on every event, with no Angular re-render in between. Look here before you build drag- or scroll-driven effects.
What it shows
mainThreadFn()— wraps a handler as a main-thread script (Glossary) that edits the element directly withsetStyleProperty(). SeemainThreadFn.[mainThreadBindtap]and[mainThreadBindtouchmove]— bind those handlers to an element's events. ImportLynxMainThreadEventto use them. SeeLynxMainThreadEvent.createMainThreadRef()— keeps the tap count between calls. SeeMainThreadRef.backgroundFn()andrunOnBackground()— call a function on the background thread (Glossary) from a main-thread script. SeebackgroundFn.- A plain
(bindtap)for comparison — the third box updates a signal and lets Angular re-render. Use that for most handlers.
