mirror of
https://github.com/ENSL/ensl_gathers.git
synced 2024-12-01 00:31:45 +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; |