%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex/demo/node_modules/alpinejs/src/magics/
Upload File :
Create Path :
Current File : /www/loslex/demo/node_modules/alpinejs/src/magics/$watch.js

import { magic } from '../magics'
import { watch } from '../reactivity'

magic('watch', (el, { evaluateLater, cleanup }) => (key, callback) => {
    let evaluate = evaluateLater(key)

    let getter = () => {
        let value

        evaluate(i => value = i)

        return value
    }

    let unwatch = watch(getter, callback)

    cleanup(unwatch)
})

Zerion Mini Shell 1.0