Skip to content

Commit 3acbb9a

Browse files
authored
Merge pull request #105 from github/shave-some-bytes
Shave some bytes
2 parents a0b9f26 + 6d70fe5 commit 3acbb9a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/auto-shadow-root.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export function autoShadowRoot(element: HTMLElement): void {
55
.attachShadow({
66
mode: template.getAttribute('data-shadowroot') === 'closed' ? 'closed' : 'open'
77
})
8-
.appendChild(template.content.cloneNode(true))
8+
.append(template.content.cloneNode(true))
99
}
1010
}
1111
}

src/bind.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export function listenForBind(el: Node = document): Subscription {
3838
}
3939
}
4040
})
41-
observer.observe(el, {childList: true, subtree: true, attributes: true, attributeFilter: ['data-action']})
41+
observer.observe(el, {childList: true, subtree: true, attributeFilter: ['data-action']})
4242
const subscription = {
4343
get closed() {
4444
return closed
@@ -94,10 +94,11 @@ function* bindings(el: Element): Iterable<Binding> {
9494
for (const action of (el.getAttribute('data-action') || '').trim().split(/\s+/)) {
9595
const eventSep = action.lastIndexOf(':')
9696
const methodSep = action.lastIndexOf('#')
97-
const type = action.slice(0, eventSep)
98-
const tag = action.slice(eventSep + 1, methodSep)
99-
const method = action.slice(methodSep + 1)
100-
yield {type, tag, method}
97+
yield {
98+
type: action.slice(0, eventSep),
99+
tag: action.slice(eventSep + 1, methodSep),
100+
method: action.slice(methodSep + 1)
101+
}
101102
}
102103
}
103104

0 commit comments

Comments
 (0)