Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Add more granular types to InitContext #1180

@NathanFlurry

Description

@NathanFlurry

Currently uses InitContext which does not define many times that are available during init. For example, you cannot access ctx.input in createVars even though it exists.

We need to replace InitContext with a more granular context type that includes the input.

The original motivation for InitContext is because some init lifecycle hooks cannot have dependent types (i.e. createState cannot define the State type in ActorContext). But some properties should be available.

Type Complexity

Occasionally, the ctx type needs to be manually defined by the user. Currently, they can import the InitContext type directly to make this simple.

We'll need to expose more granular CreateVarsContext, etc that has the correct types specified that are supported. e.g. CreateVarsContext cannot define the Vars generic param.

Workaround

For now, you can use ctx.input as MyInputType to access the input.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions