-
Notifications
You must be signed in to change notification settings - Fork 50.4k
Description
This may be controversial, but after browsing StackOverflow I believe there's way too many people that load jQuery when they really don't need it. Let's not add to that. I don't think we should be loading jQuery in the tutorial just to do an AJAX request. Let's instead have a dummy object that just returns a static list.
var CommentsService = {
data: [...hardcoded data here...],
getAll: function(callback) { callback(this.data); }
// ...
};Which could simply be replaced to implement AJAX loading.
Old post (before I thought of just using static data):
Let's replace it with standard XMLHttpRequest code and say something like "Here's some simple code for doing an AJAX request, alternatively you could use your favourite framework like jQuery, MooTools, YUI, ... instead". Having jQuery loaded in the tutorial may make people think that jQuery is necessary to use React.