usePromiseScoped
All checks were successful
Lint / lint (push) Successful in 10s

This commit is contained in:
Julien Valverdé
2025-02-18 22:28:49 +01:00
parent bfcc097882
commit e71239b903
4 changed files with 21 additions and 67 deletions

View File

@@ -15,13 +15,11 @@ const Result = Schema.Tuple(Schema.String)
type Result = typeof Result.Type
function RouteComponent() {
const promise = R.usePromise(HttpClient.HttpClient.pipe(
const promise = R.usePromiseScoped(HttpClient.HttpClient.pipe(
Effect.flatMap(client => client.get("https://www.uuidtools.com/api/generate/v4")),
HttpClient.withTracerPropagation(false),
Effect.flatMap(res => res.json),
Effect.flatMap(Schema.decodeUnknown(Result)),
Effect.scoped,
))
return (