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

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

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

function handler () {}

handler.inline = (el, { expression }, { cleanup }) => {
    let root = closestRoot(el)

    if (! root._x_refs) root._x_refs = {}

    root._x_refs[expression] = el

    cleanup(() => delete root._x_refs[expression])
}

directive('ref', handler)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy