Merge commit '36c66dd290d3ce6eb1ccd310d0c658d4a32bb8eb' as 'repos/effect'
This commit is contained in:
12
repos/effect/packages/tools/bundle/fixtures/http-client.ts
Normal file
12
repos/effect/packages/tools/bundle/fixtures/http-client.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import * as Effect from "effect/Effect"
|
||||
import * as FetchHttpClient from "effect/unstable/http/FetchHttpClient"
|
||||
import * as HttpClient from "effect/unstable/http/HttpClient"
|
||||
|
||||
Effect.gen(function*() {
|
||||
const client = yield* HttpClient.HttpClient
|
||||
const res = yield* client.get("https://jsonplaceholder.typicode.com/posts/1")
|
||||
yield* res.json
|
||||
}).pipe(
|
||||
Effect.provide(FetchHttpClient.layer),
|
||||
Effect.runPromise
|
||||
)
|
||||
Reference in New Issue
Block a user