How to use the @hookstate/core.Downgraded function in @hookstate/core

To help you get started, we’ve selected a few @hookstate/core 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 avkonst / hookstate / plugins / Touched / dist / index.js View on Github external
this.touched = function (l) {
            var t = _this.getTouched(l.path);
            if (t !== undefined) {
                // For optimization purposes, there is nothing being used from the link value
                // as a result it is left untracked and no rerender happens for the result of this function
                // when the source value is updated.
                // We do the trick to fix it, we mark the value being 'deeply used',
                // so any changes for this value or any nested will trigger rerender.
                var _1 = l.with(core.Downgraded).value;
                return t;
            }
            return initial.Initial(l).modified();
        };
    }
github avkonst / hookstate / plugins / Initial / dist / index.js View on Github external
this.getModified = function (l) {
            l.with(core.Downgraded);
            return !isEqual(l.value, _this.getInitial(l.path));
        };
        this.initialState = cloneDeep(initialValue);

@hookstate/core

The flexible, fast and extendable state management for React that is based on hooks and state usage tracking.

MIT
Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis

Similar packages