Commit 47f9ac92e1cabfef73b71fea878e805a70994e87
fold in matts review changes
mix irving committed on 4/3/2017, 8:53:49 AMParent: 704d8cb70ad1294f388f5fb5149659597e439c45
Files changed
about/async/suggest.js | changed |
about/async/suggest.js | ||
---|---|---|
@@ -1,6 +1,6 @@ | ||
1 | 1 … | var nest = require('depnest') |
2 | -var { Struct, map, concat, dictToCollection, computed, watch } = require('mutant') | |
2 … | +var { Struct, map, concat, dictToCollection, computed, lookup, watch } = require('mutant') | |
3 | 3 … | |
4 | 4 … | exports.gives = nest('about.async.suggest') |
5 | 5 … | |
6 | 6 … | exports.needs = nest({ |
@@ -54,20 +54,14 @@ | ||
54 | 54 … | suggestion, |
55 | 55 … | {idle: true} |
56 | 56 … | ) |
57 | 57 … | |
58 | - const suggestionsRecord = computed(contacts, contacts => { | |
59 | - var result = {} | |
60 | - contacts.forEach(contact => { | |
61 | - result[contact] = api.about.obs.names(contact) | |
62 | - }) | |
63 | - | |
64 | - return result | |
58 … | + const suggestionsRecord = lookup(contacts, contact => { | |
59 … | + return [contact, api.about.obs.names(contact)] | |
65 | 60 … | }) |
66 | 61 … | |
67 | - const mapableSuggestions = dictToCollection(suggestionsRecord) | |
68 | 62 … | suggestions = concat( |
69 | - map(mapableSuggestions, pluralSuggestions, {idle: true}) | |
63 … | + map(dictToCollection(suggestionsRecord), pluralSuggestions, {idle: true}) | |
70 | 64 … | ) |
71 | 65 … | |
72 | 66 … | watch(recentSuggestions) |
73 | 67 … | watch(suggestions) |
Built with git-ssb-web