a simple web player for subsonic tinysub.devins.page
subsonic navidrome javascript
11
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: add simple bounded stack implementation

Signed-off-by: oppiliappan <me@oppi.li>

authored by

oppiliappan and committed by
Tangled
6ac918f7 1766b4af

+25
+25
src/js/stack.js
··· 1 + class BoundedStack { 2 + constructor(maxSize = 32) { 3 + this.items = []; 4 + this.maxSize = maxSize; 5 + } 6 + 7 + push(item) { 8 + this.items.push(item); 9 + if (this.items.length > this.maxSize) { 10 + this.items.shift(); 11 + } 12 + } 13 + 14 + pop() { 15 + return this.items.pop(); 16 + } 17 + 18 + clear() { 19 + this.items = []; 20 + } 21 + 22 + isEmpty() { 23 + return this.items.length === 0; 24 + } 25 + }