TypeScript Error When Using `Effect.runPromise` with `getApiClient` in React Hook
Hi! I am trying to derive a client from an API I created using
I am trying to create a hook that will get the resulting client but I am getting typescript errors, and I am not sure how to get it working. This is what I have right now:
The typescript error is on
To my understanding, the issue is that Effect.runPromise only expects an Effect that has no requirements. How do I change this so I can run
effect/platform . I want to be able to use the client in my React frontend. This is the code I have for deriving it:I am trying to create a hook that will get the resulting client but I am getting typescript errors, and I am not sure how to get it working. This is what I have right now:
The typescript error is on
getApiClient and it says: Argument of type 'Effect<Api, never, HttpClient<HttpClientError, Scope>>' is not assignable to parameter of type 'Effect<Api, never, never>'To my understanding, the issue is that Effect.runPromise only expects an Effect that has no requirements. How do I change this so I can run
getApiClient and get the derived client through the hook?