getOrCreateRuntime method

MCPUIRuntime getOrCreateRuntime(
  1. AppHandle handle
)

FR-RUNTIME-001

Implementation

MCPUIRuntime getOrCreateRuntime(AppHandle handle) {
  final existing = _runtimes[handle];
  if (existing != null) {
    _logger.debug('Reusing runtime', {'handle': handle.toString()});
    return existing;
  }
  _logger.debug('Creating runtime', {'handle': handle.toString()});
  final runtime = MCPUIRuntime();
  _runtimes[handle] = runtime;
  notifyListeners();
  return runtime;
}