0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00
ghost/core/shared/models/dataProvider.json.js

35 lines
887 B
JavaScript
Raw Normal View History

/**
* Dummy dataProvider returns hardcoded JSON data until we finish migrating settings data to a datastore
*/
/*globals module, require */
(function () {
"use strict";
var _ = require('underscore'),
when = require('when'),
DataProvider,
2013-05-29 23:49:49 +01:00
instance;
DataProvider = function () {
if (!instance) {
instance = this;
2013-05-29 23:49:49 +01:00
_.extend(instance, {
data: [],
findAll: function() {
return when(instance.data);
2013-05-29 23:49:49 +01:00
},
save: function (globals) {
_.each(globals, function (global, key) {
instance.data[key] = global;
}, instance);
return when(globals);
}
});
}
return instance;
};
module.exports = DataProvider;
}());