initialize

fun initialize(dataStore: DataStore<Preferences>, configPath: String, resourceLoader: suspend (String) -> ByteArray)

Initialises the repositories for the network mock module.

Called once from NetworkMock.initModule() in devview-networkmock. Subsequent calls on recomposition are no-ops — repositories are only ever constructed once.

The dataStore instance is passed explicitly rather than read from NetworkMockDataStoreDelegate directly, keeping this initializer independent and testable in isolation.

Parameters

dataStore

The initialised DataStore instance from NetworkMockDataStoreDelegate

configPath

Path to the mocks.json configuration file relative to composeResources (e.g. "files/networkmocks/mocks.json")

resourceLoader

Function to load resource bytes from a path, provided by the integrator's resource system (e.g. Res.readBytes from Compose Resources)