© 2026 Hedgehog Software, LLC
async function fetchTinkering() { const program = Effect.gen(function* () { const client = yield* HttpClient; const ok_only_client = client.pipe(filterStatusOk); const response = yield* ok_only_client.get('https://google.com').pipe(Effect.scoped); yield* Console.log(response.headers); yield* response.stream.pipe(Stream.runForEach((chunk) => Console.log(chunk.length))); }); const program_using_fetch = program.pipe(Effect.provide(FetchHttpClient.layer)); const exit = await Effect.runPromiseExit(program_using_fetch); console.log(exit); }
{ _id: "Exit", _tag: "Success", value: undefined, }
Stream.run(response.stream, fs.sink('./tmp/file.mp4')
fetch