How to use the omi.options.afterInstall function in omi

To help you get started, we’ve selected a few omi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Tencent / omi / packages / omi-mobx / index.js View on Github external
cb({
                didTimeout: false,
                timeRemaining: function () {
                    return Math.max(0, 50 - (Date.now() - start))
                }
            })
        }, 1)
    }

window.cancelIdleCallback = window.cancelIdleCallback ||
    function (id) {
        clearTimeout(id)
    }


options.afterInstall = function (ele) {
    if (ele.constructor.observe) {
        oba(ele.data, ele)
    }
}

let idleId = null
const updateList = []

function oba(data, ele) {
    const o = observable(data)

    autorun(() => {
        JSON.stringify(o)
        if (ele._isInstalled) {
            updateList.push(ele)
            cancelIdleCallback(idleId)

omi

<p align="center"><img src="https://omijs.github.io/home/assets/logo.svg" alt="omi" width="100"/></p> <h2 align="center">Omi - Web Components Framework</h2>

MIT
Latest version published 2 months ago

Package Health Score

79 / 100
Full package analysis