MCPcopy Index your code
hub / github.com/WebReflection/wicked-elements / set

Function set

index.js:182–212  ·  view source on GitHub ↗
(value, m, l, o)

Source from the content-addressed store, hash-verified

180 };
181
182 var set = function set(value, m, l, o) {
183 var handler = create(o, {
184 element: {
185 enumerable: true,
186 value: value
187 }
188 });
189
190 for (var i = 0, length = l.length; i < length; i++) {
191 value.addEventListener(l[i].t, handler, l[i].o);
192 }
193
194 m.set(value, handler);
195 if (handler.init) handler.init();
196 var observedAttributes = o.observedAttributes;
197
198 if (observedAttributes) {
199 var mo = new MutationObserver(attributeChangedCallback);
200 mo.observe(value, {
201 attributes: true,
202 attributeOldValue: true,
203 attributeFilter: observedAttributes.map(function (attributeName) {
204 if (value.hasAttribute(attributeName)) handler.attributeChanged(attributeName, null, value.getAttribute(attributeName));
205 return attributeName;
206 })
207 });
208 attributes.set(mo, handler);
209 }
210
211 return handler;
212 };
213
214 var _QSAO = QSAO({
215 query: query,

Callers 1

index.jsFile · 0.70

Calls 2

initMethod · 0.80
attributeChangedMethod · 0.80

Tested by

no test coverage detected