mirror of
https://github.com/vale981/grapher
synced 2025-03-04 17:11:38 -05:00
21 lines
No EOL
464 B
JavaScript
21 lines
No EOL
464 B
JavaScript
export default new class {
|
|
constructor() {
|
|
this.storage = {};
|
|
}
|
|
|
|
add(key, value) {
|
|
if (this.storage[key]) {
|
|
throw new Meteor.Error('invalid-name', `You have previously defined another namedQuery with the same name: "${key}". Named Query names should be unique.`);
|
|
}
|
|
|
|
this.storage[key] = value;
|
|
}
|
|
|
|
get(key) {
|
|
return this.storage[key];
|
|
}
|
|
|
|
getAll() {
|
|
return this.storage;
|
|
}
|
|
} |