Skip to content

Instantly share code, notes, and snippets.

@myobie
Created December 8, 2024 09:00
Show Gist options
  • Select an option

  • Save myobie/83249befc275711cf469e28363b1866a to your computer and use it in GitHub Desktop.

Select an option

Save myobie/83249befc275711cf469e28363b1866a to your computer and use it in GitHub Desktop.

Revisions

  1. myobie created this gist Dec 8, 2024.
    9 changes: 9 additions & 0 deletions reactive-text-node.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    export function reactiveTextNode(signal) {
    const node = document.createTextNode(signal.value)

    effect(() => {
    node.textContent = signal.value
    })

    return node
    }