Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

twine / OnOptions

Interface: OnOptions โ€‹

Defined in: twine/src/core/events/types.ts:5

How a handler is polled.

Properties โ€‹

every? โ€‹

optional every?: number

Defined in: twine/src/core/events/types.ts:19

Check the detector every every ticks. Defaults to the module's tickEvery.

This is the main cost setting: the detector runs at this rate while the module's area is active.


once? โ€‹

optional once?: boolean

Defined in: twine/src/core/events/types.ts:11

Fire once per arming instead of every tick the condition holds. Default true.

The latch stays set until rearmEvents. Set false for bodies meant to repeat.


own? โ€‹

optional own?: string | boolean

Defined in: twine/src/core/events/types.ts:29

Put the body in its own private function instead of inlining it. Useful for long bodies.

true names it after the handler key; an unkeyed handler passes the name as a string.


phase? โ€‹

optional phase?: number

Defined in: twine/src/core/events/types.ts:22

Offset within the every period, to spread same-period handlers apart.

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.