SplitScript reference / Language / onStateReady

onStateReady

lifecycle block

onStateReady { ... }

Initializes one committed state snapshot.

Runs synchronously once per attachment, immediately after the first complete state poll. Both old and current are available and equal. The attached process is available, but suspension is not. whileAttached and timer-decision actions begin on the following update.

Examples

Use onStateReady

onStateReady {
    print(`Initial level: {current.level}`)
}