mirror of
https://github.com/legop3/MultiRoombaRover.git
synced 2026-11-14 10:42:45 -05:00
11 lines
355 B
JavaScript
11 lines
355 B
JavaScript
// Shared display ordering only; each service still owns its queue policy.
|
|
function describeQueue(queue, currentId) {
|
|
const currentIndex = currentId ? queue.indexOf(currentId) : -1;
|
|
const nextId = queue.length > 1
|
|
? queue[(currentIndex + 1) % queue.length]
|
|
: null;
|
|
return { queue, currentId, nextId };
|
|
}
|
|
|
|
module.exports = { describeQueue };
|