Make structures for data stores extensible

This commit is contained in:
Schuyler Cebulskie
2017-11-19 21:16:14 -05:00
parent ad69e2ba4c
commit cfa512c447
3 changed files with 57 additions and 1 deletions

View File

@@ -1,4 +1,5 @@
const Collection = require('../util/Collection');
const Structures = require('../util/Structures');
/**
* Manages the creation, retrieval and deletion of a specific data model.
@@ -8,7 +9,7 @@ class DataStore extends Collection {
constructor(client, iterable, holds) {
super();
Object.defineProperty(this, 'client', { value: client });
Object.defineProperty(this, 'holds', { value: holds });
Object.defineProperty(this, 'holds', { value: Structures.get(holds.name) });
if (iterable) for (const item of iterable) this.create(item);
}