refactor: cleanup store (#727)

* refactor: isolate clock

* refactor: isolate private

* refactor: remove duplicate

* chore: rename loaded > runtime

* fix: handle no events loaded
This commit is contained in:
Carlos Valente
2024-01-24 00:20:10 +01:00
committed by GitHub
parent 0cd2ca4191
commit b4ad533e6a
31 changed files with 411 additions and 384 deletions
@@ -66,7 +66,7 @@ export class EventLoader {
* finds the previous event
* @return {object | undefined}
*/
static findPrevious(currentEventId: string | null): OntimeEvent | null {
static findPrevious(currentEventId?: string): OntimeEvent | null {
const timedEvents = EventLoader.getPlayableEvents();
if (!timedEvents || !timedEvents.length) {
return null;
@@ -87,7 +87,7 @@ export class EventLoader {
* finds the next event
* @return {object | undefined}
*/
static findNext(currentEventId: string | null): OntimeEvent | null {
static findNext(currentEventId?: string): OntimeEvent | null {
const timedEvents = EventLoader.getPlayableEvents();
if (!timedEvents || !timedEvents.length) {
return null;