@@ -21,21 +21,9 @@ function Hallway (sites) {
2121 const channels = this.findChannels(entries)
2222 const users = this.findUsers(entries)
2323
24− let _entries = ''
25− for (const id in entries) {
26− const entry = entries[id]
27− _entries += `${this.templateEntry(entry)}\n`
28− }
29−
30− let _channels = ''
31− for (const id in channels) {
32− _channels += `<li>${id} ${channels[id]}</li>\n`
33− }
34−
35− let _users = ''
36− for (const id in users) {
37− _users += `<li>${id} ${users[id]}</li>\n`
38− }
24+ let _entries = entries.reduce((acc, val, id) => { return acc + this.templateEntry(val) + '\n' }, '')
25+ let _channels = Object.keys(channels).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${channels[val]}</span></li>\n` }, '')
26+ let _users = Object.keys(users).reduce((acc, val, id) => { return acc + `<li>${val} <span class='right'>${users[val]}</span></li>\n` }, '')
3927
4028 this.el.innerHTML = `
4129 <ul id='entries'>