Commit 47e9da79b4756a70bb65f6ba7223c366dced141a
apply-properties: name binding functions for debug assistance
Matt McKegg committed on 9/27/2016, 8:20:26 PMParent: ae89aab540caa1cee5f40dcc78fc2210e40b024e
Files changed
lib/apply-properties.js | changed |
lib/apply-properties.js | ||
---|---|---|
@@ -80,24 +80,24 @@ | ||
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
83 | 83 | function bindClassList (target, obs, key) { |
84 | - return watch(obs, function (value) { | |
84 | + return watch(obs, function boundClassList (value) { | |
85 | 85 | value = [].concat.apply([], value).filter(present).join(' ') |
86 | 86 | if (value || target[key]) { |
87 | 87 | target[key] = value |
88 | 88 | } |
89 | 89 | }) |
90 | 90 | } |
91 | 91 | |
92 | 92 | function bindStyle (target, styleObs, key) { |
93 | - return watch(styleObs, function (value) { | |
93 | + return watch(styleObs, function boundStyle (value) { | |
94 | 94 | target.style.setProperty(key, value) |
95 | 95 | }) |
96 | 96 | } |
97 | 97 | |
98 | 98 | function bindAttr (target, attrObs, key) { |
99 | - return watch(attrObs, function (value) { | |
99 | + return watch(attrObs, function boundAttr (value) { | |
100 | 100 | if (value == null) { |
101 | 101 | target.removeAttribute(key) |
102 | 102 | } else { |
103 | 103 | target.setAttribute(key, value) |
@@ -105,9 +105,9 @@ | ||
105 | 105 | }) |
106 | 106 | } |
107 | 107 | |
108 | 108 | function bind (target, obs, key) { |
109 | - return watch(obs, function (toValue) { | |
109 | + return watch(obs, function bound (toValue) { | |
110 | 110 | var fromValue = target.getAttribute(key) |
111 | 111 | if (fromValue !== toValue) { |
112 | 112 | target.setAttribute(key, toValue) |
113 | 113 | } |
Built with git-ssb-web