Skip to content

Instantly share code, notes, and snippets.

@normanzb
Last active August 29, 2015 14:20
Show Gist options
  • Save normanzb/660ccaa5642d2ac05964 to your computer and use it in GitHub Desktop.
Save normanzb/660ccaa5642d2ac05964 to your computer and use it in GitHub Desktop.
// here goes what englishtown does:
window._satellite_ready = window._satellite_ready || [];
window._satellite_ready.push(function(satellite){
// ... setup state object and everything else ...
satellite.track();
});
// here goes what joe does:
window._satellite_ready = window._satellite_ready || [];
// ... setup and make everything ready ...
for(var l = window._satellite_ready.length; l--;) {
window._satellite_ready[l].call(window._satellite);
}
@normanzb
Copy link
Author

to Joe:

I am not very sure if this is necessary, because i dont' know who's gonna load the satellite related scripts, and how it is loaded.

If it is us to load the related script then i think it pretty obvious when the satellite object became available and hence above code is completely unnecessary.

Let me know what do you think

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