mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
feat(globe): render the tilt and north-up buttons from the globe actions store
The camera orientation controls publish whether the map is tilted and the camera's whole-degree heading instead of writing the buttons' attributes, and answer tilt and north-up through the globe actions store. The new GlobeCompass renders the heading, so a rotating camera re-renders only the compass. The store drops an unchanged camera state and keeps each clear owner's busy state, so the buttons show the shell that answers them: a shell replaced by a newer one, or disposed mid-clear, leaves the live shell's state alone, and an older shell that answers again shows its own. createOwners gains owns() and ownerOf().
This commit is contained in:
1 parent
7edf8a577e
commit
eccaeea0c4
15 files changed
+495
-180
No files matched your search
@@ -33,3 +33,25 @@ test('act returns what the answering action returned', () => {
|
||||
assert.equal(act('pick', 'jazz'), 'kept jazz');
|
||||
assert.equal(act('missing'), undefined);
|
||||
});
|
||||
|
||||
test('owns names the owner that answers an action', () => {
|
||||
const { connect, detach, owns } = createOwners();
|
||||
const older = connect({ tilt() {}, share() {} });
|
||||
const newer = connect({ tilt() {} });
|
||||
assert.equal(owns(newer, 'tilt'), true);
|
||||
assert.equal(owns(older, 'tilt'), false);
|
||||
assert.equal(owns(older, 'share'), true);
|
||||
assert.equal(owns(newer, 'missing'), false);
|
||||
assert.equal(owns(null, 'tilt'), false);
|
||||
detach(newer);
|
||||
assert.equal(owns(older, 'tilt'), true);
|
||||
});
|
||||
|
||||
test('ownerOf names the token that answers an action', () => {
|
||||
const { connect, ownerOf } = createOwners();
|
||||
const older = connect({ clear() {}, share() {} });
|
||||
const newer = connect({ clear() {} });
|
||||
assert.equal(ownerOf('clear'), newer);
|
||||
assert.equal(ownerOf('share'), older);
|
||||
assert.equal(ownerOf('missing'), undefined);
|
||||
});
|
||||
Reference in new issue
Block a user