Welcome to mirror list, hosted at ThFree Co, Russian Federation.

x-html.js « directives « src « alpinejs « packages « alpinejs - github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b4977d3f62fdc63d0b4ee33a2caaef7a5390aabe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { evaluateLater } from '../evaluator'
import { directive } from '../directives'
import { mutateDom } from '../mutation'

directive('html', (el, { expression }, { effect, evaluateLater }) => {
    let evaluate = evaluateLater(expression)

    effect(() => {
        evaluate(value => {
            el.innerHTML = value
        })
    })
})