packages/okam-core/src/extend/data/watch/quick/index.js
function watchDataChange(expressOrFunc, callback, options) {
    if (typeof expressOrFunc === 'function') {
        expressOrFunc = this.__addComputedProp(expressOrFunc);
    }

    if (typeof callback === 'function') {
        let handlerName = getAnonymousWatcherName(this);
        this[handlerName] = callback;
        callback = handlerName;
    }

    return this.__watchDataChange(expressOrFunc, callback, options);
}
function watchDataChange(expressOrFunc, callback, options) {
    if (typeof expressOrFunc === 'function') {
        expressOrFunc = this.__addComputedProp(expressOrFunc);
    }

    if (typeof callback === 'function') {
        let handlerName = getAnonymousWatcherName(this);
        this[handlerName] = callback;
        callback = handlerName;
    }

    return this.__watchDataChange(expressOrFunc, callback, options);
}
function watchDataChange ( expressOrFunc , callback , options ) { if ( typeof expressOrFunc === 'function' ) { expressOrFunc = this . __addComputedProp ( expressOrFunc ) ; } if ( typeof callback === 'function' ) { let handlerName = getAnonymousWatcherName ( this ) ; this [ handlerName ] = callback ; callback = handlerName ; } return this . __watchDataChange ( expressOrFunc , callback , options ) ; }
Watch the given expression or function

@param {string|Function} expressOrFunc the expression or function to watch
@param {string|Function} callback the callback handler to execute when the
expression or function value changes
@param {Object=} options watch options
@param {boolean=} options.immediate whether trigger the callback
immediately with the current value of the expression or function
optional, by default false
@param {boolean=} optional.deep whether watch object nested value
optional, by default false
@return {*}
Watch the given expression or function