aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoris2025-03-22 07:39:07 +0100
committerJoris2025-03-22 07:39:07 +0100
commit03ea9806bf7ea1f97e1704451bad51ab834df54b (patch)
tree5da1b384dc159e5a1bb491e9c7a2891014485afb /src
parentc6ac1ec310db17b517c5b978752c22de5b4de3f5 (diff)
Configure element to mount to
Diffstat (limited to 'src')
-rw-r--r--src/example.ts6
-rw-r--r--src/rx.ts4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/example.ts b/src/example.ts
index 0870f4e..5a22419 100644
--- a/src/example.ts
+++ b/src/example.ts
@@ -126,7 +126,7 @@ const chrono =
}))
])
-const doubleMapChild =
+const doubleMapChild =
withState(true, isEven =>
withState('', search => {
const books = [...Array(50).keys()]
@@ -150,7 +150,7 @@ const doubleMapChild =
),
h('hr'),
isEven.map(b =>
- b
+ b
? filteredBooks.map(xs => `isEven (${xs.length})`)
: filteredBooks.map(xs => `isOdd (${xs.length})`)
),
@@ -204,7 +204,7 @@ const view = h('main',
indirectCheckbox
)
-mount(view)
+mount(document.body, view)
// Checkbox
diff --git a/src/rx.ts b/src/rx.ts
index 61a7e7f..a7d88f2 100644
--- a/src/rx.ts
+++ b/src/rx.ts
@@ -222,9 +222,9 @@ class Sequence<A> extends Rx<Array<A>> {
// Mount
-export function mount(html: Html): Cancelable {
+export function mount(element: HTMLElement, html: Html): Cancelable {
const state = new State()
- let appendRes = appendChild(state, document.body, html)
+ let appendRes = appendChild(state, element, html)
return appendRes.cancel
}