Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| {"lastUpload":"2020-03-13T02:51:08.444Z","extensionVersion":"v3.4.3"} |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
| // OOP | |
| console.log( 'OHAI'.blink() ); | |
| // Call invocation | |
| console.log( String.prototype.blink.call('OHAI') ); | |
| // $ always makes things look awesome. | |
| var $ = Function.prototype.call; | |
| // Very explicit call invocation |
| (function(){ | |
| var callback = function(){}, | |
| callbackName = 'gmapscallback'+(new Date()).getTime(); | |
| window[callbackName] = callback; | |
| define(['http://maps.googleapis.com/maps/api/js?sensor=true&callback=' + callbackName], function(){ | |
| return google.maps; | |
| }); | |
| })(); |