Memoising effects
I am creating an
I have this base code:
My various attempts at caching it have yielded various problems:
This gives rise to this type error:
It changes the type from
to
In this context, how do I help the type system? Surely not the dreaded
HttpRpcResovler but need to memoise it, because of course I do not want to recreate it for every request.I have this base code:
My various attempts at caching it have yielded various problems:
This gives rise to this type error:
TS2345: Argument of type Effect<any, unknown, unknown> is not assignable to parameter of type Effect<any, unknown, never>
Type unknown is not assignable to type never
It changes the type from
const client: <Req extends Search>(request: Req) => Rpc.Result<Req, never>
to
any.In this context, how do I help the type system? Surely not the dreaded
as?