mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Replace the ServiceLocator with direct dependency injection (#5548)
Removes the ServiceLocator singleton and instead directly injects the dependencies it was holding for more control over instantiation of the various component subtrees and better visibility over how they're being used.
This commit is contained in:
@@ -199,13 +199,16 @@ struct HomeScreenInviteCell_Previews: PreviewProvider, TestablePreview {
|
||||
let clientProxy = ClientProxyMock(.init())
|
||||
|
||||
let userSession = UserSessionMock(.init(clientProxy: clientProxy))
|
||||
|
||||
|
||||
let appSettings = AppSettings()
|
||||
let analytics = AnalyticsService.mock(settings: appSettings)
|
||||
|
||||
return HomeScreenViewModel(userSession: userSession,
|
||||
selectedRoomPublisher: CurrentValueSubject<String?, Never>(nil).asCurrentValuePublisher(),
|
||||
appSettings: ServiceLocator.shared.settings,
|
||||
analyticsService: ServiceLocator.shared.analytics,
|
||||
appSettings: appSettings,
|
||||
analyticsService: analytics,
|
||||
notificationManager: NotificationManagerMock(),
|
||||
userIndicatorController: ServiceLocator.shared.userIndicatorController)
|
||||
userIndicatorController: UserIndicatorControllerMock.default)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user