src/objectWatchProp.js
function setCallbackAsWatcherOf(callback, watchersSet) {
    if (!callback[WATCHER_IDENTIFIER]) {
        defineProperty(callback, WATCHER_IDENTIFIER, { watching: new Set() });

        defineProperty(callback, "stopWatchingAll", function(){
            callback[WATCHER_IDENTIFIER].watching.forEach(watcherList =>
                watcherList.delete(callback)
            );
            callback[WATCHER_IDENTIFIER].watching.clear();
        });
    }

    callback[WATCHER_IDENTIFIER].watching.add(watchersSet);
}
function setCallbackAsWatcherOf(callback, watchersSet) {
    if (!callback[WATCHER_IDENTIFIER]) {
        defineProperty(callback, WATCHER_IDENTIFIER, { watching: new Set() });

        defineProperty(callback, "stopWatchingAll", function(){
            callback[WATCHER_IDENTIFIER].watching.forEach(watcherList =>
                watcherList.delete(callback)
            );
            callback[WATCHER_IDENTIFIER].watching.clear();
        });
    }

    callback[WATCHER_IDENTIFIER].watching.add(watchersSet);
}
function setCallbackAsWatcherOf ( callback , watchersSet ) { if ( ! callback [ WATCHER_IDENTIFIER ] ) { defineProperty ( callback , WATCHER_IDENTIFIER , { watching : new Set ( ) } ) ; defineProperty ( callback , "stopWatchingAll" , function ( ) { callback [ WATCHER_IDENTIFIER ] . watching . forEach ( watcherList => watcherList . delete ( callback ) ) ; callback [ WATCHER_IDENTIFIER ] . watching . clear ( ) ; } ) ; } callback [ WATCHER_IDENTIFIER ] . watching . add ( watchersSet ) ; }
Store a reference to the Set instance provided on input, on the callback.
@private
@param {Function} callback
@param {Set} watchersSet
Store a reference to the Set instance provided on input on the callback .