mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-11-29 15:42:18 +00:00
17 lines
No EOL
297 B
JavaScript
17 lines
No EOL
297 B
JavaScript
"use strict";
|
|
|
|
// Method which caches a single instance for each author
|
|
|
|
var Authors = (function () {
|
|
var authors = {};
|
|
|
|
return function (author) {
|
|
if (authors[author.id]) {
|
|
return authors[author.id]
|
|
} else {
|
|
return authors[author.id] = author;
|
|
}
|
|
};
|
|
})();
|
|
|
|
module.exports = Authors; |