3 var roomRepoService = require('gitter-web-rooms/lib/room-repo-service');
5 function AssociatedRepoStrategy(/*options*/) {
6 this.associatedRepos = null;
9 AssociatedRepoStrategy.prototype = {
10 preload: function(items) {
11 return roomRepoService
12 .findAssociatedGithubRepoForRooms(items.toArray())
14 .then(function(results) {
15 this.associatedRepos = results;
20 return this.associatedRepos[item.id || item._id] || false;
23 name: 'AssociatedRepoStrategy'
26 module.exports = AssociatedRepoStrategy;