@pyreon/runtime-dom 0.11.4 → 0.11.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/template.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { NativeItem } from "@pyreon/core"
2
- import { renderEffect } from "@pyreon/reactivity"
1
+ import type { NativeItem } from '@pyreon/core'
2
+ import { renderEffect } from '@pyreon/reactivity'
3
3
 
4
4
  /**
5
5
  * Creates a row/item factory backed by HTML template cloning.
@@ -30,7 +30,7 @@ export function createTemplate<T>(
30
30
  html: string,
31
31
  bind: (el: HTMLElement, item: T) => (() => void) | null,
32
32
  ): (item: T) => NativeItem {
33
- const tmpl = document.createElement("template")
33
+ const tmpl = document.createElement('template')
34
34
  tmpl.innerHTML = html
35
35
  const proto = tmpl.content.firstElementChild as HTMLElement
36
36
 
@@ -67,7 +67,7 @@ export function _bindText(
67
67
  if (source.direct) {
68
68
  const textUpdate = () => {
69
69
  const v = source._v
70
- node.data = v == null || v === false ? "" : String(v as string | number)
70
+ node.data = v == null || v === false ? '' : String(v as string | number)
71
71
  }
72
72
  textUpdate()
73
73
  return source.direct(textUpdate)
@@ -76,7 +76,7 @@ export function _bindText(
76
76
  const fn = source as unknown as () => unknown
77
77
  return renderEffect(() => {
78
78
  const v = fn()
79
- node.data = v == null || v === false ? "" : String(v as string | number)
79
+ node.data = v == null || v === false ? '' : String(v as string | number)
80
80
  })
81
81
  }
82
82
 
@@ -143,7 +143,7 @@ const _tplCache = new Map<string, HTMLTemplateElement>()
143
143
  export function _tpl(html: string, bind: (el: HTMLElement) => (() => void) | null): NativeItem {
144
144
  let tpl = _tplCache.get(html)
145
145
  if (!tpl) {
146
- tpl = document.createElement("template")
146
+ tpl = document.createElement('template')
147
147
  tpl.innerHTML = html
148
148
  _tplCache.set(html, tpl)
149
149
  }