%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex_o/test/node_modules/alpinejs/src/magics/
Upload File :
Create Path :
Current File : /www/loslex_o/test/node_modules/alpinejs/src/magics/$refs.js

import { closestRoot, findClosest } from '../lifecycle'
import { mergeProxies } from '../scope'
import { magic } from '../magics'

magic('refs', el => {
    if (el._x_refs_proxy) return el._x_refs_proxy

    el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el))

    return el._x_refs_proxy
})

function getArrayOfRefObject(el) {
    let refObjects = []

    findClosest(el, (i) => {
        if (i._x_refs) refObjects.push(i._x_refs)
    })

    return refObjects
}

Zerion Mini Shell 1.0