This repository was archived by the owner on Jul 13, 2020. It is now read-only.
This repository was archived by the owner on Jul 13, 2020. It is now read-only.
Add in scope-bound equivalents of addEvent, addEventInterval #6
Open
Description
Perhaps addEventBound
and addEventIntervalBound
?
See microsoft/TypeScript#6739 for guidance on implementation.
This will be useful for GameStartr projects: now that they're moving to not taking in the GameStartr instance as a first parameter, there will be some overhead in always having to pass () =>
scopes.
Old:
FSP.TimeHandler.addEvent(FSP.killNormal, 7, thing);
Current (either):
FSP.TimeHandler.addEvent(FSP.killNormal.bind(FSP), 7, thing);
FSP.TimeHandler.addEvent((thing: IThing): void => FSP.killNormal(thing), 7, thing);
With this:
FSP.TimeHandler.addEventBound(FSP.killNormal, FSP, 7, thing);