New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pojo-observer

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pojo-observer - npm Package Compare versions

Comparing version 1.1.8 to 1.1.9

18

lib/useObserver.js

@@ -12,8 +12,4 @@ "use strict";

var _hash = _interopRequireDefault(require("./hash"));
var _generateId = require("./helpers/generateId");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
class EventEmitter {

@@ -249,7 +245,2 @@ constructor() {

function addHash(model) {
// eslint-disable-next-line no-param-reassign
if (!model.hash) model.hash = () => (0, _hash.default)(model);
}
let currentId = 0;

@@ -270,6 +261,6 @@

const subscriptionId = useUniqueId();
const [, stateChange] = (0, _react.useState)(model.hash());
const [, stateChange] = (0, _react.useState)(0);
const stateChangeCallback = (0, _react.useCallback)(() => {
stateChange(model.hash());
}, [model]);
stateChange(prev => prev + 1);
}, []);
(0, _react.useEffect)(() => {

@@ -283,3 +274,2 @@ eventEmitter.on(model.__observableId, subscriptionId, stateChangeCallback);

function decorate(model) {
addHash(model);
addId(model);

@@ -303,2 +293,2 @@ }

exports.default = _default;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy91c2VPYnNlcnZlci50cyJdLCJuYW1lcyI6WyJFdmVudEVtaXR0ZXIiLCJjYWxsYmFja3MiLCJvbiIsImV2ZW50SWQiLCJzdWJzY3JpcHRpb25JZCIsImNiIiwicHVzaCIsInJlbW92ZSIsImZpbHRlciIsImMiLCJlbWl0IiwiZm9yRWFjaCIsImV2ZW50RW1pdHRlciIsImdldEZpZWxkTmFtZXMiLCJ0b0NoZWNrIiwicHJvcHMiLCJvYmoiLCJjb25jYXQiLCJPYmplY3QiLCJnZXRPd25Qcm9wZXJ0eU5hbWVzIiwiZ2V0UHJvdG90eXB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AgICBuZXdQcm94eSA9IHZhbHVlXG4gICAgICAgICAgY2FsbGJhY2soKVxuICAgICAgICAgIHJldHVybiB0cnVlXG4gICAgICAgIH1cblxuICAgICAgICBuZXdQcm94eSA9IG5ldyBQcm94eSh2YWx1ZSwge1xuICAgICAgICAgIGdldCh0YXJnZXQsIHByb3BlcnR5KTogb2JqZWN0IHtcbiAgICAgICAgICAgIHJldHVybiB0YXJnZXRbcHJvcGVydHldXG4gICAgICAgICAgfSxcbiAgICAgICAgICBzZXQodGFyZ2V0LCBwcm9wZXJ0eSwgaW5uZXJWYWx1ZSk6IGJvb2xlYW4ge1xuICAgICAgICAgICAgaWYgKHByb3BlcnR5ICE9PSAnX19wcm90b19fJyAmJiBwcm9wZXJ0eSAhPT0gJ2xlbmd0aCcpIHtcbiAgICAgICAgICAgICAgaWYgKHR5cGVvZiBpbm5lclZhbHVlID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgIGF0dGFjaFByb3h5VG9Qcm9wZXJ0aWVzKGlubmVyVmFsdWUsIGNhbGxiYWNrLCBpZClcbiAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAvLyBlc2xpbnQtZGlzYWJsZS1uZXh0LWxpbmUgbm8tcGFyYW0tcmVhc3NpZ25cbiAgICAgICAgICAgICAgdGFyZ2V0W3Byb3BlcnR5XSA9IGlubmVyVmFsdWVcbiAgICAgICAgICAgICAgY2FsbGJhY2soKVxuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIHRydWVcbiAgICAgICAgICB9LFxuICAgICAgICB9KVxuICAgICAgICByZXR1cm4gY2FsbGJhY2soKVxuICAgICAgfSxcbiAgICB9KVxuICB9IGNhdGNoIChlKSB7XG4gICAgLy8gVGhpcyBpZiBkb2Vzbid0IHNlZW0gdG8gbWFrZSBhbnkgZGlmZmVyZW5jZVxuICAgIGlmIChmaWVsZE5hbWUgPT09ICdsZW5ndGgnKSByZXR1cm5cbiAgICBPYmplY3QuZGVmaW5lUHJv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lkLCBzdWJzY3JpcHRpb25JZClcbiAgfSwgW21vZGVsLl9fb2JzZXJ2YWJsZUlkLCBzdWJzY3JpcHRpb25JZCwgc3RhdGVDaGFuZ2VDYWxsYmFja10pXG4gIHJldHVybiAoKTogdm9pZCA9PiBldmVudEVtaXR0ZXIuZW1pdChtb2RlbC5fX29ic2VydmFibGVJZClcbn1cblxuZnVuY3Rpb24gZGVjb3JhdGUobW9kZWw6IE1vZGVsKTogdm9pZCB7XG4gIGFkZElkKG1vZGVsKVxufVxuXG5mdW5jdGlvbiB1c2VPYnNlcnZlcjxUIGV4dGVuZHMgTW9kZWw+KG1vZGVsOiBUKTogVCB7XG4gIGRlY29yYXRlKG1vZGVsKVxuICBjb25zdCBjYWxsYmFjayA9IHVzZVJlYWN0aWZ5KG1vZGVsKVxuICBhdHRhY2hQcm94eVRvUHJvcGVydGllcyhtb2RlbCwgY2FsbGJhY2spXG4gIHJldHVybiBtb2RlbFxufVxuXG5leHBvcnQgZnVuY3Rpb24gcHVyZU9ic2VydmVyPFQgZXh0ZW5kcyBNb2RlbD4obW9kZWw6IFQsIGNhbGxiYWNrOiBGdW5jdGlvbik6IFQge1xuICBkZWNvcmF0ZShtb2RlbClcbiAgYXR0YWNoUHJveHlUb1Byb3BlcnRpZXMobW9kZWwsIGNhbGxiYWNrKVxuICByZXR1cm4gbW9kZWxcbn1cblxuZXhwb3J0IGRlZmF1bHQgdXNlT2JzZXJ2ZXJcbiJdfQ==

@@ -8,3 +8,3 @@ {

],
"version": "1.1.8",
"version": "1.1.9",
"description": "A minimalist object observer that works with React hooks.",

@@ -43,5 +43,2 @@ "main": "lib/index.js",

"homepage": "https://github.com/xolvio/pojo-observer#readme",
"dependencies": {
"object-hash": "^2.0.0"
},
"devDependencies": {

@@ -48,0 +45,0 @@ "@babel/cli": "^7.2.3",

@@ -72,6 +72,2 @@ ![](https://github.com/xolvio/pojo-observer/workflows/CI/badge.svg) [![Maintainability](https://api.codeclimate.com/v1/badges/608e9ae53feef2fa019d/maintainability)](https://codeclimate.com/github/xolvio/pojo-observer/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/608e9ae53feef2fa019d/test_coverage)](https://codeclimate.com/github/xolvio/pojo-observer/test_coverage) ![npm](https://img.shields.io/npm/v/pojo-observer) ![NPM](https://img.shields.io/npm/l/pojo-observer)

If the values inside the POJO do not change, the `useObserver` hook will not re-render the component. Sweet!
This is achieved internally by using `setState` with a `hash` of the POJO. You can see this in action by trying to repeatedly click the "Previous Image" button. The `previousImage` command in the `Gallery` will stop changing the `currentImage` when it gets to 0, and since the values inside the POJO are no longer changing, the `hash` method on the object ensures that the React component will not re-render.
Bonus: You can test the heck out of the interaction now without having to mess with any UI testing libraries.

@@ -78,0 +74,0 @@

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