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"))

Constructors

Link copied to clipboard
constructor(config: DevToolsConfig, scope: CoroutineScope, sessionCapture: SessionCapture? = null)

Properties

Link copied to clipboard
open override val createLogic: (StoreAccessor) -> DevToolsLogic
Link copied to clipboard
open override val createMiddleware: () -> Middleware
Link copied to clipboard
open override val initialState: DevToolsState
Link copied to clipboard

Functions

Link copied to clipboard
open suspend fun selectLogic(store: StoreAccessor): ModuleLogic
Link copied to clipboard
open suspend fun selectLogicTyped(store: StoreAccessor): DevToolsLogic
Link copied to clipboard