mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 19:04:02 +00:00
feat(radio): answer the RTL-SDR card through the radio store
SdrCard calls LocalSdrControls through radio store actions instead of DOM listeners, and renders its gain options from the receiver's own R820T gain steps with page-language labels. The display and radio stores share one owner list (createOwners): the newest connected owner with an action answers it.
This commit is contained in:
1 parent
e5fa31d01e
commit
61d11ce369
12 files changed
+320
-206
No files matched your search
@@ -0,0 +1,28 @@
|
||||
// src/ui/stores/owners.test.mjs — the newest connected owner with an action
|
||||
// answers it; detaching hands the action back to the one before.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createOwners } from './owners.js';
|
||||
|
||||
test('the newest owner with an action answers it, and detach hands it back', () => {
|
||||
const { connect, detach, act } = createOwners();
|
||||
const calls = [];
|
||||
const first = connect({
|
||||
play: (n) => calls.push(['first.play', n]),
|
||||
stop: () => calls.push(['first.stop']),
|
||||
});
|
||||
const second = connect({ play: (n) => calls.push(['second.play', n]) });
|
||||
act('play', 1);
|
||||
act('stop');
|
||||
act('missing');
|
||||
detach(second);
|
||||
act('play', 2);
|
||||
detach(second);
|
||||
detach(first);
|
||||
act('play', 3);
|
||||
assert.deepEqual(calls, [
|
||||
['second.play', 1],
|
||||
['first.stop'],
|
||||
['first.play', 2],
|
||||
]);
|
||||
});
|
||||
Reference in new issue
Block a user