We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ccccb63 commit b45d3bcCopy full SHA for b45d3bc
1 file changed
src/bind.ts
@@ -72,15 +72,15 @@ function handleEvent(event: Event) {
72
}
73
74
type Binding = {type: string; tag: string; method: string}
75
-function bindings(el: Element): Binding[] {
76
- return (el.getAttribute('data-action') || '').split(' ').map(action => {
+function* bindings(el: Element): Iterable<Binding> {
+ for (const action of (el.getAttribute('data-action') || '').split(' ')) {
77
const eventSep = action.lastIndexOf(':')
78
const methodSep = action.lastIndexOf('#')
79
const type = action.slice(0, eventSep)
80
const tag = action.slice(eventSep + 1, methodSep)
81
const method = action.slice(methodSep + 1)
82
- return {type, tag, method}
83
- })
+ yield {type, tag, method}
+ }
84
85
86
function bindActions(el: Element) {
0 commit comments