Skip to content
Commit Detail

Commit 969bed0

Author
Kenton Varda <kenton@cloudflare.com> 2025-06-12 16:50:44 -0500
Parents
2d7a2c2
Tree
8ee1739
Extend wrapperModule to get env and ctx.

This improves the interface of wrapperModule, introduced a few commits ago, by:
* Treating the default export as a class instead of a function.
* Passing three arguments to its constructor: `ctx, env, appObject`

This way, we don't have to rely on `appObject` having stored `ctx` as a property with any particular name. (Older Durable Objects, that don't extend `DurableObject`, often used the name `state` instead of `ctx`.) `env`, for its part, probably isn't useful to wrappers but it felt right to be consistent.

Files changed

3 files changed~3 modified