Add request utils for complex requests
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {displayRelayUrl, GROUP_META} from "@welshman/util"
|
||||
import {load} from "@welshman/app"
|
||||
import {fly} from "@lib/transition"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
@@ -24,6 +23,7 @@
|
||||
deriveOtherRooms,
|
||||
} from "@app/state"
|
||||
import {deriveNotification, THREAD_FILTERS} from "@app/notifications"
|
||||
import {pullConservatively} from "@app/requests"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {makeSpacePath} from "@app/routes"
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
onMount(async () => {
|
||||
replaceState = Boolean(element.closest(".drawer"))
|
||||
load({relays: [url], filters: [{kinds: [GROUP_META]}]})
|
||||
pullConservatively({relays: [url], filters: [{kinds: [GROUP_META]}]})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {groupBy, uniqBy} from "@welshman/lib"
|
||||
import {REACTION} from "@welshman/util"
|
||||
import {groupBy, uniqBy, batch} from "@welshman/lib"
|
||||
import {REACTION, DELETE} from "@welshman/util"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {pubkey, repository, load, displayProfileByPubkey} from "@welshman/app"
|
||||
import {displayList} from "@lib/util"
|
||||
@@ -23,7 +24,16 @@
|
||||
)
|
||||
|
||||
onMount(() => {
|
||||
load({relays, filters})
|
||||
load({
|
||||
relays,
|
||||
filters,
|
||||
onEvent: batch(300, (events: TrustedEvent[]) => {
|
||||
load({
|
||||
relays,
|
||||
filters: [{kinds: [DELETE], "#e": events.map(e => e.id)}],
|
||||
})
|
||||
}),
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user