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

Announcement: New version with support for simpler callback syntax #56

Open
amorey opened this issue Jan 10, 2018 · 0 comments
Open

Announcement: New version with support for simpler callback syntax #56

amorey opened this issue Jan 10, 2018 · 0 comments

Comments

@amorey
Copy link
Member

amorey commented Jan 10, 2018

Hi Everyone,

I just wanted to let you know that the latest version of LoadJS (3.5.2) accepts a success function as a simple callback argument:

loadjs(['/path/to/foo.js', '/path/to/bar.js'], function() {
  // foo.js & bar.js have loaded
});

For access to more advanced features you can still pass in an object as an argument:

loadjs(['/path/to/foo.js', '/path/to/bar.js'], {
  success: function() { /* foo.js & bar.js have loaded */ },
  error: function(pathsNotFound) { /* at least one path didn't load */ },
  async: false
});

I hope that helps to simplify your LoadJS syntax! Please let me know if you have any questions or suggestions.

Andres

P.S. Special thanks to @W1zzardTPU for the suggestion and the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant