Skip to content

Instantly share code, notes, and snippets.

@jamesarosen
jamesarosen / shed_resource.js
Created August 24, 2011 01:52 — forked from mattetti/sc-simple-ds.js
Shed.Resource
(function(window) {
Shed.Resource = SC.Object.extend({
fetch: function() {
if (!this.hasFetched) {
this.hasFetched = true;
var self = this;
this.deferedFetch = $.getJSON(this.resourceURL())
.done(function(json) {
self.set('data', self.constructor.parse(json));