refactor: migrate MainLoop to TypeScript#2675
refactor: migrate MainLoop to TypeScript#2675HoloTheDrunk wants to merge 10 commits intoiTowns:masterfrom
Conversation
|
I did some brief explanation of the main loop mechanism in ##2630 if that helps! |
4313dec to
f148e62
Compare
Desplandis
left a comment
There was a problem hiding this comment.
I have some comments but +1 for typechecking this module + simplify sub.elements mess.
| AFTER_RENDER: 'after_render', | ||
| /** Fired at the end of the update */ | ||
| UPDATE_END: 'update_end', | ||
| }; |
There was a problem hiding this comment.
Since they are used as a constant set of events, you could refine the type by marking it as as const. As such the inferred type would be
{
UPDATE_START: 'update_start';
...
}instead of
{
UPDATE_START: string;
...
}There was a problem hiding this comment.
You did not take my comment into account.
| }; | |
| } as const; |
There was a problem hiding this comment.
I distinctly remember making that change, not sure what happened...
|
|
||
| // Request redraw | ||
| view.notifyChange(true); | ||
| view.notifyChange({}); |
There was a problem hiding this comment.
Prefer calling it without parameters or with layer or view as parameter if a layer or a set of layers have been updated!
|
@HoloTheDrunk One of my comment was not resolved |
Description
Migrates MainLoop to TypeScript and cleans up some of the outdated and/or unused code.
Motivation and Context
Part of the project-wide migration to TypeScript, I needed this file's migration to happen for other PRs I'm working on.