Add NostrmarketService to dependency injection container
- Introduce NOSTRMARKET_SERVICE token in the DI container for better service management. - Update market module to create and register NostrmarketService instance using the new DI pattern. - Refactor components and composables to inject NostrmarketService via the DI container, enhancing modularity and testability. These changes improve the architecture by ensuring consistent service injection and eliminating legacy singleton references, aligning with the overall dependency injection strategy.
This commit is contained in:
parent
31a9c0a9dc
commit
14d6bc6329
6 changed files with 26 additions and 36 deletions
|
|
@ -320,11 +320,13 @@ import {
|
|||
BarChart3
|
||||
} from 'lucide-vue-next'
|
||||
import type { OrderStatus } from '@/stores/market'
|
||||
import { nostrmarketService } from '../services/nostrmarketService'
|
||||
import type { NostrmarketService } from '../services/nostrmarketService'
|
||||
import { auth } from '@/composables/useAuthService'
|
||||
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
|
||||
|
||||
const router = useRouter()
|
||||
const marketStore = useMarketStore()
|
||||
const nostrmarketService = injectService(SERVICE_TOKENS.NOSTRMARKET_SERVICE) as NostrmarketService
|
||||
|
||||
// Local state
|
||||
const isGeneratingInvoice = ref<string | null>(null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue