use-subscription
Advanced tools
Comparing version 0.0.0-experimental-d7feeb25a to 0.0.0-experimental-f42431abe
{ | ||
"branch": "master", | ||
"buildNumber": "52787", | ||
"checksum": "f7a286d", | ||
"commit": "d7feeb25a", | ||
"buildNumber": "68681", | ||
"checksum": "79816fa", | ||
"commit": "f42431abe", | ||
"environment": "ci", | ||
"reactVersion": "16.10.2-experimental-d7feeb25a" | ||
"reactVersion": "16.12.0-experimental-f42431abe" | ||
} |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-experimental-d7feeb25a | ||
/** @license React v0.0.0-experimental-f42431abe | ||
* use-subscription.development.js | ||
@@ -20,95 +20,5 @@ * | ||
var _assign = require('object-assign'); | ||
var react = require('react'); | ||
/* | ||
object-assign | ||
(c) Sindre Sorhus | ||
@license MIT | ||
*/ | ||
/* eslint-disable no-unused-vars */ | ||
var getOwnPropertySymbols = Object.getOwnPropertySymbols; | ||
var hasOwnProperty = Object.prototype.hasOwnProperty; | ||
var propIsEnumerable = Object.prototype.propertyIsEnumerable; | ||
function toObject(val) { | ||
if (val === null || val === undefined) { | ||
throw new TypeError('Object.assign cannot be called with null or undefined'); | ||
} | ||
return Object(val); | ||
} | ||
function shouldUseNative() { | ||
try { | ||
if (!Object.assign) { | ||
return false; | ||
} | ||
// Detect buggy property enumeration order in older V8 versions. | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=4118 | ||
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | ||
test1[5] = 'de'; | ||
if (Object.getOwnPropertyNames(test1)[0] === '5') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test2 = {}; | ||
for (var i = 0; i < 10; i++) { | ||
test2['_' + String.fromCharCode(i)] = i; | ||
} | ||
var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | ||
return test2[n]; | ||
}); | ||
if (order2.join('') !== '0123456789') { | ||
return false; | ||
} | ||
// https://bugs.chromium.org/p/v8/issues/detail?id=3056 | ||
var test3 = {}; | ||
'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | ||
test3[letter] = letter; | ||
}); | ||
if (Object.keys(Object.assign({}, test3)).join('') !== | ||
'abcdefghijklmnopqrst') { | ||
return false; | ||
} | ||
return true; | ||
} catch (err) { | ||
// We don't expect any of the above to throw, but better to be safe. | ||
return false; | ||
} | ||
} | ||
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) { | ||
var from; | ||
var to = toObject(target); | ||
var symbols; | ||
for (var s = 1; s < arguments.length; s++) { | ||
from = Object(arguments[s]); | ||
for (var key in from) { | ||
if (hasOwnProperty.call(from, key)) { | ||
to[key] = from[key]; | ||
} | ||
} | ||
if (getOwnPropertySymbols) { | ||
symbols = getOwnPropertySymbols(from); | ||
for (var i = 0; i < symbols.length; i++) { | ||
if (propIsEnumerable.call(from, symbols[i])) { | ||
to[symbols[i]] = from[symbols[i]]; | ||
} | ||
} | ||
} | ||
} | ||
return to; | ||
}; | ||
// | ||
@@ -196,3 +106,3 @@ // In order to avoid removing and re-adding subscriptions each time this hook is called, | ||
return objectAssign({}, prevState, { | ||
return _assign({}, prevState, { | ||
value: value | ||
@@ -199,0 +109,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
/** @license React v0.0.0-experimental-d7feeb25a | ||
/** @license React v0.0.0-experimental-f42431abe | ||
* use-subscription.production.min.js | ||
@@ -10,5 +10,3 @@ * | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0}); | ||
var h=require("react"),l=Object.getOwnPropertySymbols,m=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,p=function(){try{if(!Object.assign)return!1;var a=new String("abc");a[5]="de";if("5"===Object.getOwnPropertyNames(a)[0])return!1;var c={};for(a=0;10>a;a++)c["_"+String.fromCharCode(a)]=a;if("0123456789"!==Object.getOwnPropertyNames(c).map(function(b){return c[b]}).join(""))return!1;var d={};"abcdefghijklmnopqrst".split("").forEach(function(b){d[b]=b});return"abcdefghijklmnopqrst"!== | ||
Object.keys(Object.assign({},d)).join("")?!1:!0}catch(b){return!1}}()?Object.assign:function(a,c){if(null===a||void 0===a)throw new TypeError("Object.assign cannot be called with null or undefined");var d=Object(a);for(var b,f=1;f<arguments.length;f++){var g=Object(arguments[f]);for(var k in g)m.call(g,k)&&(d[k]=g[k]);if(l){b=l(g);for(var e=0;e<b.length;e++)n.call(g,b[e])&&(d[b[e]]=g[b[e]])}}return d}; | ||
exports.useSubscription=function(a){var c=a.getCurrentValue,d=a.subscribe,b=h.useState(function(){return{getCurrentValue:c,subscribe:d,value:c()}});a=b[0];var f=b[1];b=a.value;if(a.getCurrentValue!==c||a.subscribe!==d)b=c(),f({getCurrentValue:c,subscribe:d,value:b});h.useDebugValue(b);h.useEffect(function(){function b(){if(!a){var b=c();f(function(a){return a.getCurrentValue!==c||a.subscribe!==d||a.value===b?a:p({},a,{value:b})})}}var a=!1,e=d(b);b();return function(){a=!0;e()}},[c,d]);return b}; | ||
'use strict';Object.defineProperty(exports,"__esModule",{value:!0});var e=require("object-assign"),g=require("react"); | ||
exports.useSubscription=function(a){var c=a.getCurrentValue,d=a.subscribe,b=g.useState(function(){return{getCurrentValue:c,subscribe:d,value:c()}});a=b[0];var f=b[1];b=a.value;if(a.getCurrentValue!==c||a.subscribe!==d)b=c(),f({getCurrentValue:c,subscribe:d,value:b});g.useDebugValue(b);g.useEffect(function(){function b(){if(!a){var b=c();f(function(a){return a.getCurrentValue!==c||a.subscribe!==d||a.value===b?a:e({},a,{value:b})})}}var a=!1,h=d(b);b();return function(){a=!0;h()}},[c,d]);return b}; |
{ | ||
"name": "use-subscription", | ||
"description": "Reusable hooks", | ||
"version": "0.0.0-experimental-d7feeb25a", | ||
"version": "0.0.0-experimental-f42431abe", | ||
"repository": { | ||
@@ -17,4 +17,7 @@ "type": "git", | ||
], | ||
"dependencies": { | ||
"object-assign": "^4.1.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "0.0.0-experimental-d7feeb25a" | ||
"react": "0.0.0-experimental-f42431abe" | ||
}, | ||
@@ -21,0 +24,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
13508
2
128
+ Addedobject-assign@^4.1.1
+ Addedreact@0.0.0-experimental-f42431abe(transitive)
- Removedreact@0.0.0-experimental-d7feeb25a(transitive)