Skip to content

Commit

Permalink
chore: add todo comment for prepend append
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 26, 2023
1 parent 71cf732 commit f9c607d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/runtime-vapor/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export function insert(

export function prepend(parent: ParentBlock, ...nodes: Node[]) {
if (parent instanceof Node) {
// TODO use insertBefore for better performance https://jsbench.me/rolpg250hh/1
parent.prepend(...nodes)
} else if (isArray(parent)) {
parent.unshift(...nodes)
Expand All @@ -68,6 +69,7 @@ export function prepend(parent: ParentBlock, ...nodes: Node[]) {

export function append(parent: ParentBlock, ...nodes: Node[]) {
if (parent instanceof Node) {
// TODO use insertBefore for better performance
parent.append(...nodes)
} else if (isArray(parent)) {
parent.push(...nodes)
Expand Down

0 comments on commit f9c607d

Please sign in to comment.