"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("react"),t=require("lodash");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e);function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function u(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?c(Object(t),!0).forEach((function(r){o.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}exports.useSyncProps=function(e,n,o){var c=r.useRef(n);r.useEffect((function(){if(e){var r={},i=!1;o.forEach((function(e){var o=e.key,u=e.equals,f=void 0===u?t.isEqual:u,s=e.transform,a=n[o],p=s?s(a,n):a,b=c.current[o];void 0===p||f(p,b)||(r[o]=p,i=!0)})),i&&(e.setState(r),c.current=u(u({},c.current),r))}}),[e,n,o])};
//# sourceMappingURL=useSyncProps.js.map
