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

twine / moduleFn

Function: moduleFn() โ€‹

moduleFn(owner, name, opts?): (dp) => FunctionRef

Defined in: twine/src/core/module-fn.ts:22

A handle to the function <owner's folder>/<name>: the owner builds it, any module calls it.

export const lightCampfire = moduleFn(CampfireModule, "light"); lightCampfire(dp).build(...); // in CampfireModule.register ctx.call(lightCampfire(dp)); // anywhere else

Every call returns the same function, created on first use, so module order doesn't matter.

Parameters โ€‹

owner โ€‹

ModuleRef

name โ€‹

string

opts? โ€‹

public? โ€‹

boolean

Returns โ€‹

(dp) => FunctionRef

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