broke up monolithic structure
This commit is contained in:
23
frontend/js/state.js
Normal file
23
frontend/js/state.js
Normal file
@@ -0,0 +1,23 @@
|
||||
window.App = window.App || {};
|
||||
|
||||
// Centralized runtime state for pagination, player, and UI behavior.
|
||||
App.state = {
|
||||
currentPage: 1,
|
||||
perPage: 12,
|
||||
renderedVideoIds: new Set(),
|
||||
hasNextPage: true,
|
||||
isLoading: false,
|
||||
hlsPlayer: null,
|
||||
currentLoadController: null,
|
||||
errorToastTimer: null,
|
||||
playerMode: 'modal',
|
||||
playerHome: null,
|
||||
onFullscreenChange: null,
|
||||
onWebkitEndFullscreen: null
|
||||
};
|
||||
|
||||
// Local storage keys used across modules.
|
||||
App.constants = {
|
||||
FAVORITES_KEY: 'favorites',
|
||||
FAVORITES_VISIBILITY_KEY: 'favoritesVisible'
|
||||
};
|
||||
Reference in New Issue
Block a user