mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
28 lines
481 B
JavaScript
28 lines
481 B
JavaScript
class Store {
|
|
constructor(name) {
|
|
this._name = name;
|
|
this._db = {};
|
|
}
|
|
|
|
get warmup() {
|
|
this._db = {};
|
|
return new Promise(resolve => resolve());
|
|
}
|
|
|
|
set knownListings(value) {
|
|
if (!Array.isArray(value)) throw Error('Not a valid array');
|
|
return new Promise(resolve => {
|
|
this._db[this._name] = value;
|
|
resolve(value);
|
|
});
|
|
}
|
|
|
|
get bla() {}
|
|
|
|
get knownListings() {
|
|
return this._db[this._name] || [];
|
|
}
|
|
}
|
|
|
|
module.exports = Store;
|