Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mehdux

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mehdux - npm Package Compare versions

Comparing version 0.4.5 to 0.4.8

2

dist/mehdux.esm.js

@@ -1,2 +0,2 @@

const t=Object.assign||function(t){for(var n,r=1;r<arguments.length;r++)for(var e in n=arguments[r])Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);return t};function n(t,r){return t||r?t!==r&&(!!(!t&&r||t&&!r)||(typeof t!=typeof r||(Array.isArray(t)?function(t,n,r){if(!Array.isArray(n))return!0;if(t.length!==n.length)return!0;if(0===t.length&&0===n.length)return!1;return 0!==t.filter(function(t,e){return r(t,n[e])}).length}(t,r,n):"object"!=typeof t||function(t,n,r){var e=Object.keys(t),o=Object.keys(n);if(e.length!==o.length)return!0;return 0!==e.filter(function(e,i){return e!==o[i]||r(t[e],n[e])}).length}(t,r,n)))):typeof t==typeof r}var r,e,o=(r=function(n,r,e,o){return Object.keys(n).reduce(function(i,u){return t({},i,((a={})[u]=(c=n[u],f=u,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r(),u=c(i,e()).apply(void 0,t);o(u,{name:f,args:t})}),a));var c,f,a},{})},void 0===(e=!1)&&(e=!1),function(o,i,u){void 0===o&&(o={}),void 0===i&&(i={}),void 0===u&&(u=[]);var c=[],f=o,a=r(i,h,l,s);function s(r,e){void 0===e&&(e={}),void 0!==r&&n(f,r)&&(u&&u.length>0&&(r=u.reduce(function(t,n){return n(t,{args:e.args,name:e.name,prevState:h()})},r)),f=t({},f,r),c.forEach(function(t){return t()}))}function h(t){return null===t?{}:t?t(f):f}function l(t){return null===t?{}:t?t(a):a}this.__IS_COMBINED_STORE__=e,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=a,this.getState=h,this.setState=s,this.getActions=l,this.connect=function(t){void 0===t&&(t={});var r=t.mapStateToProps,e=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,f=void 0!==u&&u,a=h(r);return function(t){var o=function(){var o=h(r);(i||n(a,o))&&(a=o,t(o,l(e)))};return f&&t(a,l(e)),c.push(o),{dispose:function(){!function(t){c=c.filter(function(n){return n!==t})}(o)}}}}});export{o as Store};
var t=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var i in n=arguments[r])Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i]);return t};function n(t,r){return t||r?t!==r&&(!!(!t&&r||t&&!r)||(typeof t!=typeof r||(Array.isArray(t)?function(t,n,r){if(!Array.isArray(n))return!0;if(t.length!==n.length)return!0;if(0===t.length&&0===n.length)return!1;return 0!==t.filter(function(t,e){return r(t,n[e])}).length}(t,r,n):"object"!=typeof t||function(t,n,r){var e=Object.keys(t),i=Object.keys(n);if(e.length!==i.length)return!0;return 0!==e.filter(function(e,o){return e!==i[o]||r(t[e],n[e])}).length}(t,r,n)))):typeof t==typeof r}var r,e,i=(r=function(n,r,e,i){return Object.keys(n).reduce(function(o,u){return t({},o,((a={})[u]=(c=n[u],f=u,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=r(),u=c(o,e()).apply(void 0,t);i(u,{name:f,args:t})}),a));var c,f,a},{})},void 0===(e=!1)&&(e=!1),function(i,o,u){void 0===i&&(i={}),void 0===o&&(o={}),void 0===u&&(u=[]);var c=[],f=i,a=r(o,l,v,s);function s(r,e){void 0===e&&(e={}),void 0!==r&&n(f,r)&&(u&&u.length>0&&(r=u.reduce(function(t,n){return n(t,{args:e.args,name:e.name,prevState:l()})},r)),f=Array.isArray(f)?r.slice():"object"==typeof f?t({},f,r):r,c.forEach(function(t){return t()}))}function l(t){return null===t?{}:t?t(f):f}function v(t){return null===t?{}:t?t(a):a}this.__IS_COMBINED_STORE__=e,this.__INITIAL_ACTIONS__=o,this.__MIDDLEWARES__=u,this.actions=a,this.getState=l,this.setState=s,this.getActions=v,this.connect=function(t){void 0===t&&(t={});var r=t.mapStateToProps,e=t.mapActionsToProps,i=t.force,o=void 0!==i&&i,u=t.leading,f=void 0!==u&&u,a=l(r);return function(t){var i=function(){var i=l(r);(o||n(a,i))&&(a=i,t(i,v(e)))};return f&&t(a,v(e)),c.push(i),{dispose:function(){!function(t){c=c.filter(function(n){return n!==t})}(i)}}}}});export{i as Store};
//# sourceMappingURL=mehdux.esm.js.map

@@ -1,2 +0,2 @@

const t=Object.assign||function(t){for(var n,r=1;r<arguments.length;r++)for(var e in n=arguments[r])Object.prototype.hasOwnProperty.call(n,e)&&(t[e]=n[e]);return t};function n(t,r){return t||r?t!==r&&(!!(!t&&r||t&&!r)||(typeof t!=typeof r||(Array.isArray(t)?function(t,n,r){if(!Array.isArray(n))return!0;if(t.length!==n.length)return!0;if(0===t.length&&0===n.length)return!1;return 0!==t.filter(function(t,e){return r(t,n[e])}).length}(t,r,n):"object"!=typeof t||function(t,n,r){var e=Object.keys(t),o=Object.keys(n);if(e.length!==o.length)return!0;return 0!==e.filter(function(e,i){return e!==o[i]||r(t[e],n[e])}).length}(t,r,n)))):typeof t==typeof r}var r,e,o=(r=function(n,r,e,o){return Object.keys(n).reduce(function(i,u){return t({},i,((a={})[u]=(c=n[u],f=u,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r(),u=c(i,e()).apply(void 0,t);o(u,{name:f,args:t})}),a));var c,f,a},{})},void 0===(e=!1)&&(e=!1),function(o,i,u){void 0===o&&(o={}),void 0===i&&(i={}),void 0===u&&(u=[]);var c=[],f=o,a=r(i,h,l,s);function s(r,e){void 0===e&&(e={}),void 0!==r&&n(f,r)&&(u&&u.length>0&&(r=u.reduce(function(t,n){return n(t,{args:e.args,name:e.name,prevState:h()})},r)),f=t({},f,r),c.forEach(function(t){return t()}))}function h(t){return null===t?{}:t?t(f):f}function l(t){return null===t?{}:t?t(a):a}this.__IS_COMBINED_STORE__=e,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=a,this.getState=h,this.setState=s,this.getActions=l,this.connect=function(t){void 0===t&&(t={});var r=t.mapStateToProps,e=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,f=void 0!==u&&u,a=h(r);return function(t){var o=function(){var o=h(r);(i||n(a,o))&&(a=o,t(o,l(e)))};return f&&t(a,l(e)),c.push(o),{dispose:function(){!function(t){c=c.filter(function(n){return n!==t})}(o)}}}}});exports.Store=o;
var t=Object.assign||function(t){for(var n,r=1,e=arguments.length;r<e;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t};function n(t,r){return t||r?t!==r&&(!!(!t&&r||t&&!r)||(typeof t!=typeof r||(Array.isArray(t)?function(t,n,r){if(!Array.isArray(n))return!0;if(t.length!==n.length)return!0;if(0===t.length&&0===n.length)return!1;return 0!==t.filter(function(t,e){return r(t,n[e])}).length}(t,r,n):"object"!=typeof t||function(t,n,r){var e=Object.keys(t),o=Object.keys(n);if(e.length!==o.length)return!0;return 0!==e.filter(function(e,i){return e!==o[i]||r(t[e],n[e])}).length}(t,r,n)))):typeof t==typeof r}var r,e,o=(r=function(n,r,e,o){return Object.keys(n).reduce(function(i,u){return t({},i,((a={})[u]=(c=n[u],f=u,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=r(),u=c(i,e()).apply(void 0,t);o(u,{name:f,args:t})}),a));var c,f,a},{})},void 0===(e=!1)&&(e=!1),function(o,i,u){void 0===o&&(o={}),void 0===i&&(i={}),void 0===u&&(u=[]);var c=[],f=o,a=r(i,l,v,s);function s(r,e){void 0===e&&(e={}),void 0!==r&&n(f,r)&&(u&&u.length>0&&(r=u.reduce(function(t,n){return n(t,{args:e.args,name:e.name,prevState:l()})},r)),f=Array.isArray(f)?r.slice():"object"==typeof f?t({},f,r):r,c.forEach(function(t){return t()}))}function l(t){return null===t?{}:t?t(f):f}function v(t){return null===t?{}:t?t(a):a}this.__IS_COMBINED_STORE__=e,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=a,this.getState=l,this.setState=s,this.getActions=v,this.connect=function(t){void 0===t&&(t={});var r=t.mapStateToProps,e=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,f=void 0!==u&&u,a=l(r);return function(t){var o=function(){var o=l(r);(i||n(a,o))&&(a=o,t(o,v(e)))};return f&&t(a,v(e)),c.push(o),{dispose:function(){!function(t){c=c.filter(function(n){return n!==t})}(o)}}}}});exports.Store=o;
//# sourceMappingURL=mehdux.js.map

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.mehdux={})}(this,function(t){const n=Object.assign||function(t){for(var n,e=1;e<arguments.length;e++)for(var r in n=arguments[e])Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t};function e(t,n){return t||n?t!==n&&(!!(!t&&n||t&&!n)||(typeof t!=typeof n||(Array.isArray(t)?function(t,n,e){if(!Array.isArray(n))return!0;if(t.length!==n.length)return!0;if(0===t.length&&0===n.length)return!1;return 0!==t.filter(function(t,r){return e(t,n[r])}).length}(t,n,e):"object"!=typeof t||function(t,n,e){var r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!0;return 0!==r.filter(function(r,i){return r!==o[i]||e(t[r],n[r])}).length}(t,n,e)))):typeof t==typeof n}var r,o,i=(r=function(t,e,r,o){return Object.keys(t).reduce(function(i,u){return n({},i,((a={})[u]=(f=t[u],c=u,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e(),u=f(i,r()).apply(void 0,t);o(u,{name:c,args:t})}),a));var f,c,a},{})},void 0===(o=!1)&&(o=!1),function(t,i,u){void 0===t&&(t={}),void 0===i&&(i={}),void 0===u&&(u=[]);var f=[],c=t,a=r(i,h,l,s);function s(t,r){void 0===r&&(r={}),void 0!==t&&e(c,t)&&(u&&u.length>0&&(t=u.reduce(function(t,n){return n(t,{args:r.args,name:r.name,prevState:h()})},t)),c=n({},c,t),f.forEach(function(t){return t()}))}function h(t){return null===t?{}:t?t(c):c}function l(t){return null===t?{}:t?t(a):a}this.__IS_COMBINED_STORE__=o,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=a,this.getState=h,this.setState=s,this.getActions=l,this.connect=function(t){void 0===t&&(t={});var n=t.mapStateToProps,r=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,c=void 0!==u&&u,a=h(n);return function(t){var o=function(){var o=h(n);(i||e(a,o))&&(a=o,t(o,l(r)))};return c&&t(a,l(r)),f.push(o),{dispose:function(){!function(t){f=f.filter(function(n){return n!==t})}(o)}}}}});t.Store=i});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n(t.mehdux={})}(this,function(t){var n=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t};function e(t,n){return t||n?t!==n&&(!!(!t&&n||t&&!n)||(typeof t!=typeof n||(Array.isArray(t)?function(t,n,e){if(!Array.isArray(n))return!0;if(t.length!==n.length)return!0;if(0===t.length&&0===n.length)return!1;return 0!==t.filter(function(t,r){return e(t,n[r])}).length}(t,n,e):"object"!=typeof t||function(t,n,e){var r=Object.keys(t),o=Object.keys(n);if(r.length!==o.length)return!0;return 0!==r.filter(function(r,i){return r!==o[i]||e(t[r],n[r])}).length}(t,n,e)))):typeof t==typeof n}var r,o,i=(r=function(t,e,r,o){return Object.keys(t).reduce(function(i,u){return n({},i,((a={})[u]=(f=t[u],c=u,function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=e(),u=f(i,r()).apply(void 0,t);o(u,{name:c,args:t})}),a));var f,c,a},{})},void 0===(o=!1)&&(o=!1),function(t,i,u){void 0===t&&(t={}),void 0===i&&(i={}),void 0===u&&(u=[]);var f=[],c=t,a=r(i,h,l,s);function s(t,r){void 0===r&&(r={}),void 0!==t&&e(c,t)&&(u&&u.length>0&&(t=u.reduce(function(t,n){return n(t,{args:r.args,name:r.name,prevState:h()})},t)),c=Array.isArray(c)?t.slice():"object"==typeof c?n({},c,t):t,f.forEach(function(t){return t()}))}function h(t){return null===t?{}:t?t(c):c}function l(t){return null===t?{}:t?t(a):a}this.__IS_COMBINED_STORE__=o,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=a,this.getState=h,this.setState=s,this.getActions=l,this.connect=function(t){void 0===t&&(t={});var n=t.mapStateToProps,r=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,c=void 0!==u&&u,a=h(n);return function(t){var o=function(){var o=h(n);(i||e(a,o))&&(a=o,t(o,l(r)))};return c&&t(a,l(r)),f.push(o),{dispose:function(){!function(t){f=f.filter(function(n){return n!==t})}(o)}}}}});t.Store=i});
//# sourceMappingURL=mehdux.umd.js.map

@@ -7,3 +7,3 @@ {

"license": "MIT",
"version": "0.4.5",
"version": "0.4.8",
"source": "src/main.ts",

@@ -13,5 +13,6 @@ "main": "dist/mehdux.js",

"browser": "dist/mehdux.umd.js",
"types": "./dist/types.d.ts",
"devDependencies": {
"@types/react": "^16.0.38",
"microbundle": "^0.4.3",
"microbundle": "^0.4.4",
"preact": "^8.2.7",

@@ -32,5 +33,5 @@ "prettier": "^1.10.2",

"dev:main": "microbundle watch --compress false",
"dev:utils": "microbundle watch src/utils.ts -o ./utils.js -f cjs --compress false",
"dev:utils": "microbundle watch src/utils.ts -o utils.js -f cjs --compress false",
"bundle:utils": "microbundle src/utils.ts -o ./utils.js -f cjs",
"bundle:picodom": "microbundle src/bindings/picodom.ts -o ./picodom.js -f cjs",
"bundle:picodom": "microbundle src/bindings/picodom.ts -o picodom.js -f cjs",
"bundle:preact": "microbundle src/bindings/preact/index.ts -o ./preact.js -f cjs",

@@ -37,0 +38,0 @@ "bundle:react": "microbundle src/bindings/react/index.ts -o ./react.js -f cjs",

@@ -1,2 +0,2 @@

var t=require("preact");const e=Object.assign||function(t){for(var e,r=1;r<arguments.length;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t};function r(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getChildContext=function(){return{store:e.props.store}},e}return r(e,t),e.prototype.render=function(){return this.props.children[0]},e.displayName="Provider",e}(t.Component);n.displayName="Provider";var o=function(t){return t&&"object"==typeof t&&!Array.isArray(t)};exports.Provider=n,exports.connect=function(n){var i=void 0===n?{}:n,p=i.store,a=i.mapStateToProps,s=i.mapActionsToProps;return function(n){var i=function(i){function c(t,e){var r=i.call(this,t,e)||this;return r.handleUpdate=r.handleUpdate.bind(r),r.store=p||e.store,r.state=r.getMergedState(r.store.getState(a),r.store.getActions(s)),r}return r(c,i),c.prototype.componentDidMount=function(){this.connection=this.store.connect({leading:!1,mapActionsToProps:s,mapStateToProps:a})(this.handleUpdate)},c.prototype.componentWillUnmount=function(){this.connection.dispose()},c.prototype.handleUpdate=function(t,e){this.setState(this.getMergedState(t,e))},c.prototype.getMergedState=function(t,r){return this.store.__IS_COMBINED_STORE__?function(t,r){var n={};for(var i in t)t.hasOwnProperty(i)&&(n[i]=o(t[i])?e({},t[i],r[i]):t[i]);for(var i in r)r.hasOwnProperty(i)&&(n[i]=o(r[i])?e({},t[i],r[i]):r[i]);return n}(r,t):e({},r,t)},c.prototype.render=function(){return t.h(n,e({},this.state,this.props))},c}(t.Component);return i.displayName="Connected("+(n.displayName||n.name||"Component")+")",i}};
var t=require("preact"),e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])};function o(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}var r=Object.assign||function(t){for(var e,o=1,r=arguments.length;o<r;o++)for(var n in e=arguments[o])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},n=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.getChildContext=function(){return{store:e.props.store}},e}return o(e,t),e.prototype.render=function(){return this.props.children[0]},e.displayName="Provider",e}(t.Component);n.displayName="Provider";var i=function(t){return t&&"object"==typeof t&&!Array.isArray(t)};exports.Provider=n,exports.connect=function(e){var n=void 0===e?{}:e,p=n.store,a=n.mapStateToProps,s=n.mapActionsToProps;return function(e){var n=function(n){function c(t,e){var o=n.call(this,t,e)||this;return o.handleUpdate=o.handleUpdate.bind(o),o.store=p||e.store,o.state=o.getMergedState(o.store.getState(a),o.store.getActions(s)),o}return o(c,n),c.prototype.componentDidMount=function(){this.connection=this.store.connect({leading:!1,mapActionsToProps:s,mapStateToProps:a})(this.handleUpdate)},c.prototype.componentWillUnmount=function(){this.connection.dispose()},c.prototype.handleUpdate=function(t,e){this.setState(this.getMergedState(t,e))},c.prototype.getMergedState=function(t,e){return this.store.__IS_COMBINED_STORE__?function(t,e){var o={};for(var n in t)t.hasOwnProperty(n)&&(o[n]=i(t[n])?r({},t[n],e[n]):t[n]);for(var n in e)e.hasOwnProperty(n)&&(o[n]=i(e[n])?r({},t[n],e[n]):e[n]);return o}(e,t):r({},e,t)},c.prototype.render=function(){return t.h(e,r({},this.state,this.props))},c}(t.Component);return n.displayName="Connected("+(e.displayName||e.name||"Component")+")",n}};
//# sourceMappingURL=preact.js.map

@@ -1,2 +0,2 @@

var t=require("react");const e=Object.assign||function(t){for(var e,n=1;n<arguments.length;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function n(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);function o(){this.constructor=t}t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}var o=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},r={store:function(){}},i=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return n(o,e),o.prototype.getChildContext=function(){return{store:this.props.store}},o.prototype.render=function(){return t.Children.only(this.props.children)},o}(t.Component);i.displayName="Provider",i.childContextTypes=r,exports.connect=function(i){var p=void 0===i?{}:i,s=p.store,a=p.mapStateToProps,c=p.mapActionsToProps;return function(i){var p=function(r){function p(t,e){var n=r.call(this,t,e)||this;return n.displayName="Connected("+(i.displayName||i.name||"Component")+")",n.handleUpdate=n.handleUpdate.bind(n),n.store=s||e.store,n.state=n.getMergedState(n.store.getState(a),n.store.getActions(c)),n}return n(p,r),p.prototype.componentDidMount=function(){this.connection=this.store.connect({leading:!1,mapActionsToProps:c,mapStateToProps:a})(this.handleUpdate)},p.prototype.componentWillUnmount=function(){this.connection.dispose()},p.prototype.handleUpdate=function(t,e){this.setState(this.getMergedState(t,e))},p.prototype.getMergedState=function(t,n){return this.store.__IS_COMBINED_STORE__?function(t,n){var r={};for(var i in t)t.hasOwnProperty(i)&&(r[i]=o(t[i])?e({},t[i],n[i]):t[i]);for(var i in n)n.hasOwnProperty(i)&&(r[i]=o(n[i])?e({},t[i],n[i]):n[i]);return r}(n,t):e({},n,t)},p.prototype.render=function(){return t.createElement(i,e({},this.state,this.props))},p}(t.Component);return p.contextTypes=r,p}},exports.Provider=i;
var t=require("react"),e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])};function o(t,o){function n(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}var n=Object.assign||function(t){for(var e,o=1,n=arguments.length;o<n;o++)for(var r in e=arguments[o])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r=function(t){return t&&"object"==typeof t&&!Array.isArray(t)},i={store:function(){}},p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return o(n,e),n.prototype.getChildContext=function(){return{store:this.props.store}},n.prototype.render=function(){return t.Children.only(this.props.children)},n}(t.Component);p.displayName="Provider",p.childContextTypes=i,exports.connect=function(e){var p=void 0===e?{}:e,s=p.store,a=p.mapStateToProps,c=p.mapActionsToProps;return function(e){var p=function(i){function p(t,o){var n=i.call(this,t,o)||this;return n.displayName="Connected("+(e.displayName||e.name||"Component")+")",n.handleUpdate=n.handleUpdate.bind(n),n.store=s||o.store,n.state=n.getMergedState(n.store.getState(a),n.store.getActions(c)),n}return o(p,i),p.prototype.componentDidMount=function(){this.connection=this.store.connect({leading:!1,mapActionsToProps:c,mapStateToProps:a})(this.handleUpdate)},p.prototype.componentWillUnmount=function(){this.connection.dispose()},p.prototype.handleUpdate=function(t,e){this.setState(this.getMergedState(t,e))},p.prototype.getMergedState=function(t,e){return this.store.__IS_COMBINED_STORE__?function(t,e){var o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=r(t[i])?n({},t[i],e[i]):t[i]);for(var i in e)e.hasOwnProperty(i)&&(o[i]=r(e[i])?n({},t[i],e[i]):e[i]);return o}(e,t):n({},e,t)},p.prototype.render=function(){return t.createElement(e,n({},this.state,this.props))},p}(t.Component);return p.contextTypes=i,p}},exports.Provider=p;
//# sourceMappingURL=react.js.map

@@ -10,3 +10,3 @@ import * as Preact from 'preact'

interface IConnect {
export interface IConnect {
store?: IStoreInstance

@@ -17,3 +17,3 @@ mapActionsToProps?: MapActionsToProps

interface IState {
export interface IState {
store: IStoreInstance

@@ -20,0 +20,0 @@ state: {}

@@ -5,3 +5,3 @@ import * as Preact from 'preact'

interface IProps {
export interface IProps {
store: IStoreInstance

@@ -8,0 +8,0 @@ }

@@ -11,3 +11,3 @@ import * as React from 'react'

interface IConnect {
export interface IConnect {
store?: IStoreInstance

@@ -18,3 +18,3 @@ mapStateToProps?: MapStateToProps

interface IState {
export interface IState {
store: IStoreInstance

@@ -21,0 +21,0 @@ state: {}

@@ -1,2 +0,2 @@

export { connect } from './connect'
export { connect, IConnect } from './connect'
export { Provider } from './Provider'

@@ -6,3 +6,3 @@ import * as React from 'react'

interface IProps {
export interface IProps {
store: IStoreInstance

@@ -9,0 +9,0 @@ }

@@ -17,2 +17,3 @@ import { isDifferent } from './diff'

IState,
IMiddlewareArg,
MapActionsToProps,

@@ -65,7 +66,13 @@ MapStateToProps,

}
if (Array.isArray(state)) {
state = [...newState]
} else if (typeof state === 'object') {
state = {
...state,
...newState
}
} else {
state = newState
}
state = {
...state,
...newState
}
emit()

@@ -72,0 +79,0 @@ }

import { assembleStore } from './lib/assembleStore'
import { createActions } from './lib/helpers'
import { IActions, IMiddlewareArg } from './types'

@@ -4,0 +5,0 @@ const Store = assembleStore(createActions, false)

@@ -1,4 +0,4 @@

import { MapStateToProps } from './types'
// import { MapStateToProps } from './types'
export type Dispatch = (actionName: string, ...args: any[]) => void
export type IState = object
export type IState = any
export type GetState = (MapStateToProps?) => object

@@ -5,0 +5,0 @@ export type SetState = (state: IState, extraArgs?: IExtraSetStateArgs) => void

@@ -1,5 +0,5 @@

import { Middlewares } from '../types'
import { IMiddlewareArg, Middlewares } from '../types'
const applyMiddleware = (...args: Middlewares): Middlewares => args
export { applyMiddleware }
export { applyMiddleware, Middlewares, IMiddlewareArg }

@@ -21,3 +21,3 @@ import { assembleStore } from '../lib/assembleStore'

type combinedMiddlewares = Middlewares[] | true
export type combinedMiddlewares = Middlewares[] | true

@@ -24,0 +24,0 @@ function combineStores(stores = {}, newMiddlewares: combinedMiddlewares = []) {

import { IState } from '../types'
interface IConfig {
export interface IConfig {
key: string

@@ -9,3 +9,3 @@ expire?: number

interface IPersistState {
export interface IPersistState {
set: (State) => IState

@@ -12,0 +12,0 @@ get: () => IState

@@ -1,2 +0,2 @@

const t=Object.assign||function(t){for(var e,n=1;n<arguments.length;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t};function e(t,n){return t||n?t!==n&&(!!(!t&&n||t&&!n)||(typeof t!=typeof n||(Array.isArray(t)?function(t,e,n){if(!Array.isArray(e))return!0;if(t.length!==e.length)return!0;if(0===t.length&&0===e.length)return!1;return 0!==t.filter(function(t,r){return n(t,e[r])}).length}(t,n,e):"object"!=typeof t||function(t,e,n){var r=Object.keys(t),o=Object.keys(e);if(r.length!==o.length)return!0;return 0!==r.filter(function(r,i){return r!==o[i]||n(t[r],e[r])}).length}(t,n,e)))):typeof t==typeof n}var n,r,o=function(t){return[].concat.apply([],t)},i=(n=function(e,n,r,o){return Object.keys(e).reduce(function(i,u){return t({},i,((a={})[u]=Object.keys(e[u]).reduce(function(i,a){return t({},i,((l={})[a]=(c=u,f=a,s=e[u][a],function(){for(var e,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];o(((e={})[c]=t({},s(n()[c],r()).apply(void 0,i)),e),{name:c+"."+f,args:i})}),l));var c,f,s,l},{}),a));var a},{})},void 0===(r=!0)&&(r=!1),function(o,i,u){void 0===o&&(o={}),void 0===i&&(i={}),void 0===u&&(u=[]);var a=[],c=o,f=n(i,l,p,s);function s(n,r){void 0===r&&(r={}),void 0!==n&&e(c,n)&&(u&&u.length>0&&(n=u.reduce(function(t,e){return e(t,{args:r.args,name:r.name,prevState:l()})},n)),c=t({},c,n),a.forEach(function(t){return t()}))}function l(t){return null===t?{}:t?t(c):c}function p(t){return null===t?{}:t?t(f):f}this.__IS_COMBINED_STORE__=r,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=f,this.getState=l,this.setState=s,this.getActions=p,this.connect=function(t){void 0===t&&(t={});var n=t.mapStateToProps,r=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,c=void 0!==u&&u,f=l(n);return function(t){var o=function(){var o=l(n);(i||e(f,o))&&(f=o,t(o,p(r)))};return c&&t(f,p(r)),a.push(o),{dispose:function(){!function(t){a=a.filter(function(e){return e!==t})}(o)}}}}});var u=function(){return(new Date).getTime()};exports.combineStores=function(t,e){void 0===t&&(t={}),void 0===e&&(e=[]);var n=Object.keys(t),r={},u={},a=[];return Array.isArray(e)&&a.push(e),n.forEach(function(n){t[n]&&(!0===e&&a.push.apply(a,t[n].__MIDDLEWARES__),r[n]=t[n].getState(),u[n]=t[n].__INITIAL_ACTIONS__)}),new i(r,u,o(a))},exports.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},exports.persistState=function(t){if(!t)return null;var e,n=t.key,r=t.interval,o=void 0===r?1e3:r;if(!n)throw new Error("You need to specify a key");var i=function(){n&&localStorage.removeItem(n)};return{set:function(r){if(function(t,e){return t&&t<u()+e}(e,o))return r;e=u();var i={expiryDate:t.expire?(new Date).getTime()+t.expire:null,state:r};return localStorage.setItem(n,JSON.stringify(i)),r},get:function(){var t=JSON.parse(localStorage.getItem(n));if(t){var e=t.state,r=t.expiryDate;if(!r)return e;if(r>u())return e;i()}return{}},purge:i}},exports.logger=function(t,e){var n=e.prevState,r=e.args;return void 0!==typeof window.console&&(console.group("Recieved action: "+e.name),console.info("Arguments: "+r.join[", "]+"."),console.info("Previous state:",n),console.info("Next state:",t),console.groupEnd()),t};
var t=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t};function e(t,r){return t||r?t!==r&&(!!(!t&&r||t&&!r)||(typeof t!=typeof r||(Array.isArray(t)?function(t,e,r){if(!Array.isArray(e))return!0;if(t.length!==e.length)return!0;if(0===t.length&&0===e.length)return!1;return 0!==t.filter(function(t,n){return r(t,e[n])}).length}(t,r,e):"object"!=typeof t||function(t,e,r){var n=Object.keys(t),o=Object.keys(e);if(n.length!==o.length)return!0;return 0!==n.filter(function(n,i){return n!==o[i]||r(t[n],e[n])}).length}(t,r,e)))):typeof t==typeof r}var r,n,o=function(t){return[].concat.apply([],t)},i=(r=function(e,r,n,o){return Object.keys(e).reduce(function(i,u){return t({},i,((a={})[u]=Object.keys(e[u]).reduce(function(i,a){return t({},i,((l={})[a]=(c=u,f=a,s=e[u][a],function(){for(var e,i=[],u=0;u<arguments.length;u++)i[u]=arguments[u];o(((e={})[c]=t({},s(r()[c],n()).apply(void 0,i)),e),{name:c+"."+f,args:i})}),l));var c,f,s,l},{}),a));var a},{})},void 0===(n=!0)&&(n=!1),function(o,i,u){void 0===o&&(o={}),void 0===i&&(i={}),void 0===u&&(u=[]);var a=[],c=o,f=r(i,l,p,s);function s(r,n){void 0===n&&(n={}),void 0!==r&&e(c,r)&&(u&&u.length>0&&(r=u.reduce(function(t,e){return e(t,{args:n.args,name:n.name,prevState:l()})},r)),c=Array.isArray(c)?r.slice():"object"==typeof c?t({},c,r):r,a.forEach(function(t){return t()}))}function l(t){return null===t?{}:t?t(c):c}function p(t){return null===t?{}:t?t(f):f}this.__IS_COMBINED_STORE__=n,this.__INITIAL_ACTIONS__=i,this.__MIDDLEWARES__=u,this.actions=f,this.getState=l,this.setState=s,this.getActions=p,this.connect=function(t){void 0===t&&(t={});var r=t.mapStateToProps,n=t.mapActionsToProps,o=t.force,i=void 0!==o&&o,u=t.leading,c=void 0!==u&&u,f=l(r);return function(t){var o=function(){var o=l(r);(i||e(f,o))&&(f=o,t(o,p(n)))};return c&&t(f,p(n)),a.push(o),{dispose:function(){!function(t){a=a.filter(function(e){return e!==t})}(o)}}}}});var u=function(){return(new Date).getTime()};exports.combineStores=function(t,e){void 0===t&&(t={}),void 0===e&&(e=[]);var r=Object.keys(t),n={},u={},a=[];return Array.isArray(e)&&a.push(e),r.forEach(function(r){t[r]&&(!0===e&&a.push.apply(a,t[r].__MIDDLEWARES__),n[r]=t[r].getState(),u[r]=t[r].__INITIAL_ACTIONS__)}),new i(n,u,o(a))},exports.applyMiddleware=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t},exports.persistState=function(t){if(!t)return null;var e,r=t.key,n=t.interval,o=void 0===n?1e3:n;if(!r)throw new Error("You need to specify a key");var i=function(){r&&localStorage.removeItem(r)};return{set:function(n){if(function(t,e){return t&&t<u()+e}(e,o))return n;e=u();var i={expiryDate:t.expire?(new Date).getTime()+t.expire:null,state:n};return localStorage.setItem(r,JSON.stringify(i)),n},get:function(){var t=JSON.parse(localStorage.getItem(r));if(t){var e=t.state,n=t.expiryDate;if(!n)return e;if(n>u())return e;i()}return{}},purge:i}},exports.logger=function(t,e){var r=e.prevState,n=e.args;return void 0!==typeof window.console&&(console.group("Recieved action: "+e.name),console.info("Arguments: "+n.join[", "]+"."),console.info("Previous state:",r),console.info("Next state:",t),console.groupEnd()),t};
//# sourceMappingURL=utils.js.map

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc