UNPKG

reactive-props

Version:

An all-in-one implementation of the Reactive State for Data & DOM patterns.

1 lines 1.25 kB
self.reactiveProps=function(t){"use strict";var n=Object.defineProperties,e=Object.keys,r=function(t,n,e,r,o){return{configurable:!0,get:function(){return r},set:function(u){(t||u!==r||n&&"object"==typeof u&&u)&&(r=u,e?o.call(this,r):o.call(this))}}},o=function(t,n,o,i,a,c){for(var l={},f=a!==u,v=[o,i,f],s=e(t),d=0;d<s.length;d++){var h=n(t,s[d]),b=f?a(h):[h,a];c&&(b[1]=c),l[s[d]]=r.apply(null,v.concat(b))}return l},u=function(){},i=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.all,r=void 0!==e&&e,i=t.shallow,a=void 0===i||i,c=t.useState,l=void 0===c?u:c,f=t.getAttribute,v=void 0===f?function(t,n){return t.getAttribute(n)}:f;return function(t,e,u){var i=o(e,(function(n,e){var r=n[e],o=typeof r;return t.hasOwnProperty(e)?(r=t[e],delete t[e]):t.hasAttribute(e)&&(r=v(t,e),"number"==o?r=+r:"boolean"==o&&(r=!/^(?:false|0|)$/.test(r))),r}),r,a,l,u);return n(t,i)}},a=function(t,n){return t[n]},c=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.all,r=void 0!==e&&e,i=t.shallow,c=void 0===i||i,l=t.useState,f=void 0===l?u:l;return function(t,e){return n({},o(t,a,r,c,f,e))}};return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(t.dom?i:c)(t)}}();