Triton/Packages/Account/Sources/Account/Environment/AccountEnvironment.swift
Otávio 3e878667a1 Add Triton App
Signed-off-by: Otavio Cordeiro <otaviocc@users.noreply.github.com>
2025-12-15 20:39:07 +01:00

35 lines
730 B
Swift

import MicroContainer
import SessionServiceInterface
struct AccountEnvironment {
// MARK: - Properties
var viewModelFactory: ViewModelFactory {
container.resolve()
}
private let container = DependencyContainer()
// MARK: - Lifecycle
init(
sessionService: any SessionServiceProtocol
) {
container.register(
type: (any SessionServiceProtocol).self,
allocation: .dynamic
) { _ in
sessionService
}
container.register(
type: ViewModelFactory.self,
allocation: .static
) { container in
ViewModelFactory(
container: container
)
}
}
}