From 6217e3b70ac11c789d8957bba25de939a30d011a Mon Sep 17 00:00:00 2001 From: padreug Date: Tue, 16 Sep 2025 21:43:23 +0200 Subject: [PATCH] Add FeedService and integrate into NostrFeed module - Introduced FeedService to manage feed functionality, including subscription and deduplication of posts. - Updated NostrFeed module to register FeedService in the DI container and initialize it during installation. - Refactored useFeed composable to utilize FeedService for managing feed state and loading posts. - Enhanced NostrFeed component to display posts and handle loading states more effectively. - Changed Home.vue to use the 'all' feed type for broader content display. These changes improve the modularity and functionality of the feed system, providing a more robust user experience. --- src/core/di-container.ts | 5 +- .../nostr-feed/components/NostrFeed.vue | 205 ++---------- src/modules/nostr-feed/composables/useFeed.ts | 110 ++---- src/modules/nostr-feed/index.ts | 42 ++- .../nostr-feed/services/FeedService.ts | 314 ++++++++++++++++++ src/pages/Home.vue | 2 +- 6 files changed, 408 insertions(+), 270 deletions(-) create mode 100644 src/modules/nostr-feed/services/FeedService.ts diff --git a/src/core/di-container.ts b/src/core/di-container.ts index 7a0a137..0b3d93a 100644 --- a/src/core/di-container.ts +++ b/src/core/di-container.ts @@ -131,7 +131,10 @@ export const SERVICE_TOKENS = { // Chat services CHAT_SERVICE: Symbol('chatService'), - + + // Feed services + FEED_SERVICE: Symbol('feedService'), + // Events services EVENTS_SERVICE: Symbol('eventsService'), diff --git a/src/modules/nostr-feed/components/NostrFeed.vue b/src/modules/nostr-feed/components/NostrFeed.vue index 2b031c7..fd77b26 100644 --- a/src/modules/nostr-feed/components/NostrFeed.vue +++ b/src/modules/nostr-feed/components/NostrFeed.vue @@ -1,29 +1,28 @@