mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +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:
@@ -103,7 +103,7 @@ struct EmojiPickerScreen: View {
|
||||
struct EmojiPickerScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static let viewModel = EmojiPickerScreenViewModel(itemID: .randomEvent,
|
||||
selectedEmojis: ["😀", "😄"],
|
||||
emojiProvider: EmojiProvider(appSettings: ServiceLocator.shared.settings),
|
||||
emojiProvider: EmojiProvider(appSettings: AppSettings()),
|
||||
timelineController: MockTimelineController())
|
||||
|
||||
static var previews: some View {
|
||||
@@ -116,7 +116,7 @@ struct EmojiPickerScreen_Previews: PreviewProvider, TestablePreview {
|
||||
struct EmojiPickerScreenSheet_Previews: PreviewProvider {
|
||||
static let viewModel = EmojiPickerScreenViewModel(itemID: .randomEvent,
|
||||
selectedEmojis: ["😀", "😄"],
|
||||
emojiProvider: EmojiProvider(appSettings: ServiceLocator.shared.settings),
|
||||
emojiProvider: EmojiProvider(appSettings: AppSettings()),
|
||||
timelineController: MockTimelineController())
|
||||
|
||||
static var previews: some View {
|
||||
|
||||
Reference in New Issue
Block a user