Effect CommunityEC
Effect Communityβ€’3y agoβ€’
51 replies
imagio

Reading Cached Values from Request Cache

I'm trying to read or manipulate cached values in the request cache but the currentRequestCache FiberRef contains a "ConsumerCache" which can't be read from. How can I read from the Request cache? (for example if I want to only get cached values without actually running a request)

const readCached = (request: AnyRequest) =>
    pipe(
        FiberRef.currentRequestCache,
        FiberRef.get,
        T.flatMap(cache => //??? this is a ConsumerCache which can't be read)
    )
Was this page helpful?