Commit a02496d0475717090976150d52e656f9915bcf7f
Remove hPull function
Charles Lehner committed on 8/14/2016, 4:25:28 AMParent: bde94ec16b8af91da0d44e2d4bd6ce54d9c23e65
Files changed
modules/theme.js | changed |
modules/theme.js | ||
---|---|---|
@@ -74,34 +74,30 @@ | ||
74 | 74 | link.feed ? h('a', {href: '#'+link.feed}, avatar_name(link.feed)) : '' |
75 | 75 | ) |
76 | 76 | } |
77 | 77 | |
78 | -function hPull() { | |
79 | - var args = [].slice.call(arguments) | |
80 | - var stream = args.pop() | |
81 | - var parent = h.apply(this, args) | |
82 | - pull(stream, pull.drain(function (el) { | |
83 | - parent.appendChild(el) | |
84 | - }, function (err) { | |
85 | - if (err) console.error(err) | |
86 | - })) | |
87 | - return parent | |
88 | -} | |
89 | - | |
90 | 78 | function theme_view() { |
91 | 79 | var themeInput |
80 | + var themesList = h('form.themes__list') | |
92 | 81 | |
82 | + pull( | |
83 | + themes(), | |
84 | + pull.unique('id'), | |
85 | + pull.map(renderTheme), | |
86 | + pull.drain(function (el) { | |
87 | + themesList.appendChild(el) | |
88 | + }, function (err) { | |
89 | + if (err) console.error(err) | |
90 | + }) | |
91 | + ) | |
92 | + | |
93 | 93 | return h('div.column.scroll-y', h('div', |
94 | 94 | updateForm(h('form.themes__form', {onsubmit: onsubmit, onreset: onreset}, |
95 | 95 | themeInput = h('input.themes__id', {placeholder: 'theme id', |
96 | 96 | value: link.href}), ' ', |
97 | 97 | h('input.themes__reset', {type: 'reset'}), ' ', |
98 | 98 | h('input.themes__submit', {type: 'submit', value: 'Save'}))), |
99 | - hPull('form.themes__list', pull( | |
100 | - themes(), | |
101 | - pull.unique('id'), // TODO: update existing items with new data | |
102 | - pull.map(renderTheme) | |
103 | - )) | |
99 | + themesList | |
104 | 100 | )) |
105 | 101 | |
106 | 102 | function onsubmit(e) { |
107 | 103 | e.preventDefault() |
Built with git-ssb-web