diff options
author | Samuel Newman <mozzius@protonmail.com> | 2025-04-04 17:15:40 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-04 07:15:40 -0700 |
commit | a0c644acfee6e80f610041cc872f89a5fcdc22b1 (patch) | |
tree | 2a587afa1cae1757610dcd39f955803566ef597e /src/state/cache/post-shadow.ts | |
parent | a15658cb66ba9d24903994512c4eb4277647d721 (diff) | |
download | voidsky-a0c644acfee6e80f610041cc872f89a5fcdc22b1.tar.zst |
[Explore] Add shadow cache (#8119)
* enable shadowcache for feed previews * extract keyextractor * dedupe feeds
Diffstat (limited to 'src/state/cache/post-shadow.ts')
-rw-r--r-- | src/state/cache/post-shadow.ts | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/src/state/cache/post-shadow.ts b/src/state/cache/post-shadow.ts index b456a76d9..923e5c000 100644 --- a/src/state/cache/post-shadow.ts +++ b/src/state/cache/post-shadow.ts @@ -2,18 +2,19 @@ import {useEffect, useMemo, useState} from 'react' import { AppBskyEmbedRecord, AppBskyEmbedRecordWithMedia, - AppBskyFeedDefs, + type AppBskyFeedDefs, } from '@atproto/api' -import {QueryClient} from '@tanstack/react-query' +import {type QueryClient} from '@tanstack/react-query' import EventEmitter from 'eventemitter3' import {batchedUpdates} from '#/lib/batchedUpdates' -import {findAllPostsInQueryData as findAllPostsInNotifsQueryData} from '../queries/notifications/feed' -import {findAllPostsInQueryData as findAllPostsInFeedQueryData} from '../queries/post-feed' -import {findAllPostsInQueryData as findAllPostsInQuoteQueryData} from '../queries/post-quotes' -import {findAllPostsInQueryData as findAllPostsInThreadQueryData} from '../queries/post-thread' -import {findAllPostsInQueryData as findAllPostsInSearchQueryData} from '../queries/search-posts' -import {castAsShadow, Shadow} from './types' +import {findAllPostsInQueryData as findAllPostsInExploreFeedPreviewsQueryData} from '#/state/queries/explore-feed-previews' +import {findAllPostsInQueryData as findAllPostsInNotifsQueryData} from '#/state/queries/notifications/feed' +import {findAllPostsInQueryData as findAllPostsInFeedQueryData} from '#/state/queries/post-feed' +import {findAllPostsInQueryData as findAllPostsInQuoteQueryData} from '#/state/queries/post-quotes' +import {findAllPostsInQueryData as findAllPostsInThreadQueryData} from '#/state/queries/post-thread' +import {findAllPostsInQueryData as findAllPostsInSearchQueryData} from '#/state/queries/search-posts' +import {castAsShadow, type Shadow} from './types' export type {Shadow} from './types' export interface PostShadow { @@ -154,4 +155,10 @@ function* findPostsInCache( for (let post of findAllPostsInQuoteQueryData(queryClient, uri)) { yield post } + for (let post of findAllPostsInExploreFeedPreviewsQueryData( + queryClient, + uri, + )) { + yield post + } } |