NetworkMockViewModel
ViewModel for the Network Mock screen.
This ViewModel manages the state and business logic for the network mocking UI, combining data from configuration files and persisted state to provide a complete view of available mocks and their current settings.
Responsibilities
Load mock configuration from resources
Observe persisted mock state from DataStore
Combine config and state into UI-friendly models
Handle user actions (toggle mocking, select responses)
Manage loading and error states
State Flow
The ViewModel exposes a single uiState flow that combines:
Mock configuration (from JSON file)
Runtime state (from DataStore)
Discovered response files (from resources)
Functions
Resets all endpoint mocks to use actual network.
Sets the mock state for a specific endpoint identified by an EndpointKey.
Toggles global mocking on/off.