• Returns a list of affected (accessed) JSON paths (and sub-paths) in the value. This function is provided mostly as a debugging tool to see which JSON paths might have caused the cache invalidation in memoize().

    See

    Example

    import { watch, getAffectedPaths } from '@indutny/sneequals';

    const value = { a: { b: 1 } };
    const { proxy, watcher } = watch(value);

    // Prints `1`
    console.log(proxy.a.b);

    // Prints `['a.b']`
    console.log(getAffectedPaths(watcher, value));

    Parameters

    • watcher: IWatcher

      A watcher object that tracked the access to paths/sub-paths of the value

    • value: unknown

      A value tracked by watcher

    Returns readonly string[]

Generated using TypeDoc