Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.get = function( done ){
if (!cachedGetResults){
// Simple schema
var BasicSchema = declare( [ SimpleSchema, hotplate.config.get( 'hotplate.SchemaMixin') ] );
// Sets the DB Layer
var DbLayer = declare([ SimpleDbLayer, hotplate.config.get('hotplate.DbLayerMixin') ], {
db: hotplate.config.get( 'hotplate.db' )
});
// Creates a basic DB store based on that layer
var BasicDbStore = declare( [ JsonRestStores, JsonRestStores.SimpleDbLayerMixin, JsonRestStores.HTTPMixin ], {
DbLayer: DbLayer,
chainErrors: 'all'
});
// Legacy names
var HotSchema = BasicSchema;
var HotStore = BasicDbStore;
cachedGetResults = { DbLayer, BasicSchema, HotSchema, BasicDbStore, HotStore }
}
if( done ) return done( null, cachedGetResults );
else return( cachedGetResults );
};
}
self.broadcastStoreChanges( request, m, d[ self.idProperty], d, {}, done );
});
},
});
// Sets the DB Layer
var DbLayer = declare([ SimpleDbLayer, hotplate.config.get('hotplate.DbLayerMixin') ], {
db: hotplate.config.get( 'hotplate.db' )
});
// Creates a basic DB store based on that layer
classes.BasicDbStore = declare( [ JsonRestStores, JsonRestStores.SimpleDbLayerMixin, JsonRestStores.HTTPMixin ], {
DbLayer: DbLayer,
});
// Creates the HotStore: the basic DB store with HotStoreMixin
classes.HotStore = declare( [ classes.BasicDbStore, classes.HotStoreMixin ]);
done( null, classes );
}
});