drhayes Posted October 15, 2015 Share Posted October 15, 2015 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. ( = MattMcFarland 1 Link to comment Share on other sites More sharing options...
jmp909 Posted October 15, 2015 Share Posted October 15, 2015 ah thanks for that info! i was actually binding because I didn't realise there was a listenerContext argument originally. then I ended up putting both in, rather than take the bind out... have removed it now. Link to comment Share on other sites More sharing options...
Recommended Posts