DriftScript bindings · function

bindModule

Give a loaded module its host, and refuse in words when the host cannot satisfy it.

Explained in Setting up scripts.

function bindModule(module: DriftModule, services: HostServices): BindResult
import { bindModule } from '@driftengine/script';

Parameters

ParameterTypeDescription
moduleDriftModule
servicesHostServices

In depth

Checked against __drift.requires before anything is called, so a missing service is reported at bind time naming the module — rather than at the first capability call, deep in a frame, as an undefined property.