All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.src.directives.x-html.js Maven / Gradle / Ivy

There is a newer version: 3.14.1
Show newest version
import { directive } from '../directives'
import { initTree } from '../lifecycle'
import { mutateDom } from '../mutation'

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

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

                el._x_ignoreSelf = true
                initTree(el)
                delete el._x_ignoreSelf
            })
        })
    })
})




© 2015 - 2024 Weber Informatics LLC | Privacy Policy