preloadstore.js 528 B

123456789101112131415161718192021222324252627282930313233
  1. /* global MisagoData */
  2. var MisagoPreloadStore = function() {
  3. return {
  4. data: MisagoData || {},
  5. has: function(key) {
  6. return this.data.hasOwnProperty(key);
  7. },
  8. get: function(key, value) {
  9. if (this.has(key)) {
  10. return this.data[key];
  11. } else if (value !== undefined) {
  12. return value;
  13. } else {
  14. return undefined;
  15. }
  16. },
  17. set: function(key, value) {
  18. this.data[key] = value;
  19. return value;
  20. }
  21. };
  22. }();
  23. export default MisagoPreloadStore;