Jump to content

Timer Countdown then Change State


Jaspery
 Share

Recommended Posts

Functionally, they do the same thing (see what I did there?).

 

Under the covers "this.shoveDownComplete.bind(this);" is making a new function every time. That'll put pressure on the GC, like making new objects or arrays.

 

And, yeah, SignalBinding doesn't use bind. That'd be more appropriate for the site of the callback. It uses apply: https://github.com/photonstorm/phaser/blob/db641ca82e608470bd7902de3447d048d9715ab5/src/core/SignalBinding.js#L122

 

"this._listener" is the callback, "this.context" is the, uh, callbackContext. ( =

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...