Skip to content

Commit

Permalink
refactor: Entry.events prop auto init
Browse files Browse the repository at this point in the history
  • Loading branch information
gnlow committed Dec 5, 2023
1 parent 0cddcae commit 320f7fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,7 @@ export class Entry {

constructor(project: Project) {
this.project = project
this.events = {
start: [],
scene_start: [],
}
this.events = {}

this.scenes = Object.fromEntries(
this.project.scenes.map(
Expand Down Expand Up @@ -138,6 +135,9 @@ export class Entry {
)
}
on(eventName: string, f: () => void) {
if (!this.events[eventName]) {
this.events[eventName] = []
}
this.events[eventName].push(f)
}
start() {
Expand Down

0 comments on commit 320f7fc

Please sign in to comment.