Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding multiple objects #4

Closed
GoodBoyDigital opened this issue Mar 3, 2015 · 3 comments
Closed

Adding multiple objects #4

GoodBoyDigital opened this issue Mar 3, 2015 · 3 comments

Comments

@GoodBoyDigital
Copy link

Hows about we make it so that we can load an array of objects?

@englercj
Copy link
Owner

englercj commented Mar 4, 2015

Are you talking about a different syntax for .add()?

Like:

loader.add([
    { key: 'someKey1', url: 'http://...' },
    { key: 'someKey2', url: 'http://...' },
    { url: 'http://...' },
    { url: 'http://...' }
]);

Is that what you're looking for?

@englercj
Copy link
Owner

englercj commented Mar 4, 2015

Added an object and array syntax. All the following will now work fine:

loader
    .add('key', 'http://...', function () {})
    .add('http://...', function () {})
    .add(['http://...', 'http://...'])
    .add({ name: 'key2', url: 'http://...' }, function () {})
    .add({ url: 'http://...' }, function () {})
    .add({ name: 'key3', url: 'http://...', onComplete: function () {} })
    .add({ url: 'http://...', onComplete: function () {} })
    .add([
        { name: 'key4', url: 'http://...', onComplete: function () {} },
        { url: 'http://...', onComplete: function () {} },
        'http://...',
        'http://...'
    ]);

@GoodBoyDigital
Copy link
Author

this is PERFECT :) 👍

@englercj englercj mentioned this issue May 4, 2015
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

No branches or pull requests

2 participants