0.2.4 #38

Merged
Thilawyn merged 44 commits from next into master 2026-03-16 00:30:17 +01:00
2 changed files with 3 additions and 2 deletions
Showing only changes of commit 2766e86f5d - Show all commits

View File

@@ -11,7 +11,7 @@ extends Pipeable.Pipeable {
readonly [QueryTypeId]: QueryTypeId readonly [QueryTypeId]: QueryTypeId
readonly context: Context.Context<Scope.Scope | QueryClient.QueryClient | R> readonly context: Context.Context<Scope.Scope | QueryClient.QueryClient | R>
readonly key: Stream.Stream<K> readonly key: Stream.Stream<K, never, never>
readonly f: (key: K) => Effect.Effect<A, E, R> readonly f: (key: K) => Effect.Effect<A, E, R>
readonly initialProgress: P readonly initialProgress: P

View File

@@ -18,9 +18,10 @@ const ResultView = Component.make("ResultView")(function*() {
const [idRef, query, mutation] = yield* Component.useOnMount(() => Effect.gen(function*() { const [idRef, query, mutation] = yield* Component.useOnMount(() => Effect.gen(function*() {
const idRef = yield* SubscriptionRef.make(1) const idRef = yield* SubscriptionRef.make(1)
const key = Stream.map(idRef.changes, id => [id] as const)
const query = yield* Query.service({ const query = yield* Query.service({
key: Stream.map(idRef.changes, id => [id] as const), key,
f: ([id]) => HttpClient.HttpClient.pipe( f: ([id]) => HttpClient.HttpClient.pipe(
Effect.tap(Effect.sleep("500 millis")), Effect.tap(Effect.sleep("500 millis")),
Effect.andThen(client => client.get(`https://jsonplaceholder.typicode.com/posts/${ id }`)), Effect.andThen(client => client.get(`https://jsonplaceholder.typicode.com/posts/${ id }`)),