DevToolsModule
class DevToolsModule(config: DevToolsConfig, scope: CoroutineScope, sessionCapture: SessionCapture? = null) : ModuleWithLogic<DevToolsState, DevToolsAction, DevToolsLogic> (source)
Module for DevTools connection management.
This module provides state/logic for connection management AND the middleware for intercepting actions. Simply register the module and everything is wired up automatically.
Example usage:
val introspectionConfig = IntrospectionConfig(platform = "Android")
val sessionCapture = SessionCapture()
val store = createStore {
module(IntrospectionModule(introspectionConfig, sessionCapture))
module(DevToolsModule(
config = DevToolsConfig(
introspectionConfig = introspectionConfig,
serverUrl = "ws://192.168.1.100:8080/ws"
),
scope = lifecycleScope,
sessionCapture = sessionCapture
))
// ... other modules
}
// Later, connect via action (if serverUrl was null):
store.dispatch(DevToolsAction.Connect("ws://192.168.1.100:8080/ws"))Content copied to clipboard