MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / _setDataSource

Method _setDataSource

web/rusense/services/sensing.service.js:388–396  ·  view source on GitHub ↗

* Update the dataSource label and notify state listeners so the UI can * react without needing a separate subscription. * @param {'live'|'server-simulated'|'reconnecting'|'simulated'} source

(source)

Source from the content-addressed store, hash-verified

386 * @param {'live'|'server-simulated'|'reconnecting'|'simulated'} source
387 */
388 _setDataSource(source) {
389 if (source === this._dataSource) return;
390 this._dataSource = source;
391 // Re-use the same state-listener channel — listeners receive the
392 // connection state but can read dataSource via service.dataSource.
393 for (const cb of this._stateListeners) {
394 try { cb(this._state); } catch (e) { /* ignore */ }
395 }
396 }
397
398 _clearTimers() {
399 this._stopSimulation();

Callers 5

_connectMethod · 0.95
_scheduleReconnectMethod · 0.95
_fallbackToSimulationMethod · 0.95
_detectServerSourceMethod · 0.95
_applyServerSourceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected