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

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

There is a newer version: 3.14.1
Show newest version
import { directive, prefix } from "../directives";
import { addInitSelector } from "../lifecycle";
import { skipDuringClone } from "../clone";

addInitSelector(() => `[${prefix('init')}]`)

directive('init', skipDuringClone((el, { expression }, { evaluate }) => {
    if (typeof expression === 'string') {
        return !! expression.trim() && evaluate(expression, {}, false)
    }

    return evaluate(expression, {}, false)
}))




© 2015 - 2024 Weber Informatics LLC | Privacy Policy