function watch(propName, options) {
    const resolvedOptions = {
        waitUntilFirstUpdate: true,
        ...options
    };
    return (target, decoratedFnName)=>{
        const { update } = target;
        target.update = function(changedProps) {
            if (changedProps.has(propName)) {
                const oldValue = changedProps.get(propName);
                const newValue = this[propName];
                if (oldValue !== newValue) {
                    if (!resolvedOptions.waitUntilFirstUpdate || this.hasUpdated) this[decoratedFnName](oldValue, newValue);
                }
            }
            update.call(this, changedProps);
        };
    };
}
export { watch };
