Get rid of loadOne since it only works for id-based filters, not addresses

This commit is contained in:
Jon Staab
2024-09-04 17:29:31 -07:00
parent 8874884b9b
commit 25845dc837
6 changed files with 11 additions and 25 deletions
+2 -2
View File
@@ -4,7 +4,7 @@ import {indexBy, type Maybe, now} from '@welshman/lib'
import {getIdFilters} from '@welshman/util'
import type {TrustedEvent} from '@welshman/util'
import {withGetter, deriveEvents} from '@welshman/store'
import {repository, loadOne} from './core'
import {repository, load} from './core'
import {getFreshness, setFreshness} from './freshness'
export const collection = <T, LoadArgs extends any[]>({
@@ -71,7 +71,7 @@ export const deriveEvent = (idOrAddress: string, request: Partial<SubscribeReque
deriveEvents(repository, {filters, includeDeleted: true}),
(events: TrustedEvent[]) => {
if (!attempted && events.length === 0) {
loadOne({...request, filters})
load({...request, filters})
attempted = true
}