mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-06 00:37:23 +00:00
Add AbortSignal's to things
This commit is contained in:
4 files changed
+13
-17
No files matched your search
+3
-2
@@ -106,8 +106,9 @@ function usePosts() {
|
||||
|
||||
return useQuery({
|
||||
queryKey: ['posts'],
|
||||
queryFn: async () => {
|
||||
const events = await nostr.query([{ kinds: [1], limit: 20 }]);
|
||||
queryFn: async (c) => {
|
||||
const signal = AbortSignal.any([c.signal, AbortSignal.timeout(1500)]);
|
||||
const events = await nostr.query([{ kinds: [1], limit: 20 }], { signal });
|
||||
return events; // these events could be transformed into another format
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user