@reffuse/extension-query 0.1.5 #16
@@ -17,8 +17,9 @@ function RouteComponent() {
|
|||||||
key: R.useStreamFromReactiveValues(["uuid4", 10 as number]),
|
key: R.useStreamFromReactiveValues(["uuid4", 10 as number]),
|
||||||
query: ([, count]) => Console.log(`Querying ${ count } IDs...`).pipe(
|
query: ([, count]) => Console.log(`Querying ${ count } IDs...`).pipe(
|
||||||
Effect.andThen(Effect.sleep("500 millis")),
|
Effect.andThen(Effect.sleep("500 millis")),
|
||||||
Effect.andThen(HttpClient.HttpClient.pipe(
|
Effect.andThen(Effect.map(
|
||||||
Effect.map(HttpClient.withTracerPropagation(false))
|
HttpClient.HttpClient,
|
||||||
|
HttpClient.withTracerPropagation(false),
|
||||||
)),
|
)),
|
||||||
Effect.flatMap(client => client.get(`https://www.uuidtools.com/api/generate/v4/count/${ count }`)),
|
Effect.flatMap(client => client.get(`https://www.uuidtools.com/api/generate/v4/count/${ count }`)),
|
||||||
Effect.flatMap(res => res.json),
|
Effect.flatMap(res => res.json),
|
||||||
|
|||||||
@@ -29,8 +29,11 @@ function RouteComponent() {
|
|||||||
Effect.tap(() => QueryProgress.QueryProgress.update(() =>
|
Effect.tap(() => QueryProgress.QueryProgress.update(() =>
|
||||||
AsyncData.Progress.make({ loaded: 50, total: Option.some(100) })
|
AsyncData.Progress.make({ loaded: 50, total: Option.some(100) })
|
||||||
)),
|
)),
|
||||||
Effect.andThen(HttpClient.get(`https://www.uuidtools.com/api/generate/v4/count/${ count }`)),
|
Effect.andThen(Effect.map(
|
||||||
|
HttpClient.HttpClient,
|
||||||
HttpClient.withTracerPropagation(false),
|
HttpClient.withTracerPropagation(false),
|
||||||
|
)),
|
||||||
|
Effect.flatMap(client => client.get(`https://www.uuidtools.com/api/generate/v4/count/${ count }`)),
|
||||||
Effect.flatMap(res => res.json),
|
Effect.flatMap(res => res.json),
|
||||||
Effect.flatMap(Schema.decodeUnknown(Result)),
|
Effect.flatMap(Schema.decodeUnknown(Result)),
|
||||||
Effect.scoped,
|
Effect.scoped,
|
||||||
|
|||||||
@@ -23,15 +23,18 @@ function RouteComponent() {
|
|||||||
key: R.useStreamFromReactiveValues(["uuid4", count]),
|
key: R.useStreamFromReactiveValues(["uuid4", count]),
|
||||||
query: ([, count]) => Console.log(`Querying ${ count } IDs...`).pipe(
|
query: ([, count]) => Console.log(`Querying ${ count } IDs...`).pipe(
|
||||||
Effect.andThen(Effect.sleep("500 millis")),
|
Effect.andThen(Effect.sleep("500 millis")),
|
||||||
Effect.andThen(HttpClient.get(`https://www.uuidtools.com/api/generate/v4/count/${ count }`)),
|
Effect.andThen(Effect.map(
|
||||||
|
HttpClient.HttpClient,
|
||||||
HttpClient.withTracerPropagation(false),
|
HttpClient.withTracerPropagation(false),
|
||||||
|
)),
|
||||||
|
Effect.flatMap(client => client.get(`https://www.uuidtools.com/api/generate/v4/count/${ count }`)),
|
||||||
Effect.flatMap(res => res.json),
|
Effect.flatMap(res => res.json),
|
||||||
Effect.flatMap(Schema.decodeUnknown(Result)),
|
Effect.flatMap(Schema.decodeUnknown(Result)),
|
||||||
Effect.scoped,
|
Effect.scoped,
|
||||||
),
|
),
|
||||||
})
|
})
|
||||||
|
|
||||||
const [state] = R.useSubscribeRefs(query.state)
|
const [state] = R.useSubscribeRefs(query.stateRef)
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
Reference in New Issue
Block a user