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

react-updater

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-updater - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

4

dist/react-updater.js

@@ -88,4 +88,4 @@ (function (global, factory) {

_this.cachedHandleCount = 0;
_this.handleCallbacksRefs = new Map();
_this.updateCallbacksRefs = new Map();
_this.handleCallbacksRefs = new WeakMap();
_this.updateCallbacksRefs = new WeakMap();

@@ -92,0 +92,0 @@ _this.handle = function (fn) {

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.withUpdater=t(e.React)}(this,function(e){"use strict";function t(e){return!0===c(e)&&"[object Object]"===Object.prototype.toString.call(e)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="default"in e?e.default:e,c=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)},i=function(e){var n,r;return!1!==t(e)&&("function"==typeof(n=e.constructor)&&(r=n.prototype,!1!==t(r)&&!1!==r.hasOwnProperty("isPrototypeOf")))},f=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s="@@STATE";return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(c){return function(e){function p(e){a(this,p);var u=o(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,e));if(u.cachedUpdateCount=0,u.cachedHandleCount=0,u.handleCallbacksRefs=new Map,u.updateCallbacksRefs=new Map,u.handle=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;t>a;a++)n[a-1]=arguments[a];if(!u.handleCallbacksRefs.has(e)){var o=function t(){for(var n=arguments.length,a=Array(n),o=0;n>o;o++)a[o]=arguments[o];return e.apply(void 0,r(t.values).concat(a))};return o.values=n,u.handleCallbacksRefs.set(e,o),u.cachedHandleCount++,o}var l=u.handleCallbacksRefs.get(e);return l.values=n,l},u.update=function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),o=1;t>o;o++)a[o-1]=arguments[o];if(!u.updateCallbacksRefs.has(e)){var l=function t(){for(var a=arguments.length,o=Array(a),l=0;a>l;l++)o[l]=arguments[l];var c=t.values;u.setState(function(t){return void 0===t[s]?e.apply(void 0,[t].concat(r(c),o)):n({},s,e.apply(void 0,[t[s]].concat(r(c),o)))})};return l.values=a,u.updateCallbacksRefs.set(e,l),u.cachedUpdateCount++,l}var c=u.updateCallbacksRefs.get(e);return c.values=a,c},"function"==typeof t){var l=t(e);u.state=i(l)?l:n({},s,l)}else u.state=i(t)?t:n({},s,t);return u}return u(p,e),f(p,[{key:"componentWillUnmount",value:function(){this.cachedHandleCount=null,this.cachedUpdateCount=null,this.handleCallbacksRefs=null,this.updateCallbacksRefs=null}},{key:"render",value:function(){var e=void 0===this.state[s]?this.state:this.state[s];return l.createElement(c,Object.assign({},this.props,{handle:this.handle,state:e,update:this.update}))}}]),p}(e.Component)}}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):e.withUpdater=t(e.React)}(this,function(e){"use strict";function t(e){return!0===c(e)&&"[object Object]"===Object.prototype.toString.call(e)}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);e.length>t;t++)n[t]=e[t];return n}return Array.from(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function u(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var l="default"in e?e.default:e,c=function(e){return null!=e&&"object"==typeof e&&!1===Array.isArray(e)},i=function(e){var n,r;return!1!==t(e)&&("function"==typeof(n=e.constructor)&&(r=n.prototype,!1!==t(r)&&!1!==r.hasOwnProperty("isPrototypeOf")))},f=function(){function e(e,t){for(var n=0;t.length>n;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s="@@STATE";return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return function(c){return function(e){function p(e){a(this,p);var u=o(this,(p.__proto__||Object.getPrototypeOf(p)).call(this,e));if(u.cachedUpdateCount=0,u.cachedHandleCount=0,u.handleCallbacksRefs=new WeakMap,u.updateCallbacksRefs=new WeakMap,u.handle=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;t>a;a++)n[a-1]=arguments[a];if(!u.handleCallbacksRefs.has(e)){var o=function t(){for(var n=arguments.length,a=Array(n),o=0;n>o;o++)a[o]=arguments[o];return e.apply(void 0,r(t.values).concat(a))};return o.values=n,u.handleCallbacksRefs.set(e,o),u.cachedHandleCount++,o}var l=u.handleCallbacksRefs.get(e);return l.values=n,l},u.update=function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),o=1;t>o;o++)a[o-1]=arguments[o];if(!u.updateCallbacksRefs.has(e)){var l=function t(){for(var a=arguments.length,o=Array(a),l=0;a>l;l++)o[l]=arguments[l];var c=t.values;u.setState(function(t){return void 0===t[s]?e.apply(void 0,[t].concat(r(c),o)):n({},s,e.apply(void 0,[t[s]].concat(r(c),o)))})};return l.values=a,u.updateCallbacksRefs.set(e,l),u.cachedUpdateCount++,l}var c=u.updateCallbacksRefs.get(e);return c.values=a,c},"function"==typeof t){var l=t(e);u.state=i(l)?l:n({},s,l)}else u.state=i(t)?t:n({},s,t);return u}return u(p,e),f(p,[{key:"componentWillUnmount",value:function(){this.cachedHandleCount=null,this.cachedUpdateCount=null,this.handleCallbacksRefs=null,this.updateCallbacksRefs=null}},{key:"render",value:function(){var e=void 0===this.state[s]?this.state:this.state[s];return l.createElement(c,Object.assign({},this.props,{handle:this.handle,state:e,update:this.update}))}}]),p}(e.Component)}}});

@@ -45,4 +45,4 @@ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

_this.cachedHandleCount = 0;
_this.handleCallbacksRefs = new Map();
_this.updateCallbacksRefs = new Map();
_this.handleCallbacksRefs = new WeakMap();
_this.updateCallbacksRefs = new WeakMap();

@@ -49,0 +49,0 @@ _this.handle = function (fn) {

@@ -56,4 +56,4 @@ 'use strict';

_this.cachedHandleCount = 0;
_this.handleCallbacksRefs = new Map();
_this.updateCallbacksRefs = new Map();
_this.handleCallbacksRefs = new WeakMap();
_this.updateCallbacksRefs = new WeakMap();

@@ -60,0 +60,0 @@ _this.handle = function (fn) {

{
"name": "react-updater",
"description": "Functional stateful components made easy",
"version": "1.0.2",
"version": "1.0.3",
"browser": "dist/react-updater.js",

@@ -52,4 +52,4 @@ "main": "lib/index.js",

"enzyme": "^2.8.2",
"eslint": "^3.19.0",
"eslint-plugin-import": "^2.2.0",
"eslint": "^4.0.0",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-react": "^7.0.1",

@@ -56,0 +56,0 @@ "gzip-size": "^3.0.0",

@@ -24,4 +24,4 @@ /**

cachedHandleCount = 0;
handleCallbacksRefs = new Map();
updateCallbacksRefs = new Map();
handleCallbacksRefs = new WeakMap();
updateCallbacksRefs = new WeakMap();

@@ -28,0 +28,0 @@ constructor(props) {

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