Skip to content

Conversation

@shshaw
Copy link

@shshaw shshaw commented Nov 1, 2017

Currently add, addImage, addAudio, etc. do not return the LoaderType instance that's created and returned in addFromLoaderType.

By returning the instance, it makes it easy to change with event callbacks like so:

loader
  .addImage('./test.jpg')
    .on('complete',function(){ console.log('All done with test.jpg!'); })
    .on('error',function(){ console.warn('test.jpg didn't load!'); });

Currently `add`, `addImage`, `addAudio`, etc. do not return the LoaderType instance that's created and returned in `addFromLoaderType`.

By returning the instance, it makes it easy to change with event callbacks like so:
```
loader
  .addImage('./test.jpg')
    .on('complete',function(){ console.log('All done with test.jpg!'); })
    .on('error',function(){ console.warn('test.jpg didn't load!'); });
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant