Created
June 1, 2016 19:11
-
-
Save jonathan/2f9c72f449f0dba282457520ead20eb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var pubsub = new PubSub(); | |
class DataStore { | |
catalogFiles = null, | |
init: function() { | |
var promise = new $.Promise(); | |
getCatalogFiles(); | |
}, | |
getCatalogFiles() { | |
var that = this; | |
$.ajax({}).done(function() { | |
that.catalogFiles = response.catalog; | |
pubsub.publish('datastore.change.catalog_files', that.catalogFiles); | |
}); | |
} | |
}; | |
var ds = new DataStore; | |
var dm = null; | |
pubsub.subscribe('datastore.loadData', function() { | |
ds.init(); | |
}); | |
pubsub.subscribe('datastore.change.catalog_files', function(catalogFiles) { | |
dm = new DataMapper({ | |
inFiles = catalogFiles | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment