Effect CommunityEC
Effect Community2y ago
46 replies
Bilal

Seeking Best Practice for Layering `Excel.RequestContext` in `Effect`

🤔 I am currently trying to figure out how I can best layer an Excel.RequestContext in effect, the problem is that you can only get an Excel.RequestContext via

await Excel.run(async (context: Excel.RequestContext) => ...);


so I am unsure how to layer this appropriately. I thought about basically doing:

Effect.tryPromise(() => Excel.run((context: Excel.RequestContext) => Effect.runPromise(inner.provide(RequestContext.layer(context))))


but that feels super hacky.
Was this page helpful?