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

@rooks/use-mutation-observer

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rooks/use-mutation-observer - npm Package Compare versions

Comparing version 1.0.13 to 1.0.14

30

lib/index.js

@@ -1,27 +0,3 @@

"use strict";
var _react = require("react");
var config = {
attributes: true,
characterData: true,
subtree: true,
childList: true
};
module.exports = function (ref, callback) {
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : config;
(0, _react.useEffect)(function () {
// Create an observer instance linked to the callback function
if (ref.current) {
var observer = new MutationObserver(function (mutationList, observer) {
callback(mutationList, observer);
}); // Start observing the target node for configured mutations
observer.observe(ref.current, options);
return function () {
observer.disconnect();
};
}
}, [ref.current, callback, options]);
};
"use strict";var _react=require("react"),config={attributes:!0,characterData:!0,subtree:!0,childList:!0};module.exports=function(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:config;(0,_react.useEffect)(function(){// Create an observer instance linked to the callback function
if(a.current){var d=new MutationObserver(function(a,c){b(a,c)});// Start observing the target node for configured mutations
return d.observe(a.current,c),function(){d.disconnect()}}},[a.current,b,c])};

4

package.json

@@ -27,3 +27,3 @@ {

],
"version": "1.0.13",
"version": "1.0.14",
"_id": "@rooks/use-mutation-observer@",

@@ -37,3 +37,3 @@ "publishConfig": {

},
"gitHead": "dfd1ff21eec3f6c8de8ed0b78d5abe7fa9a53662"
"gitHead": "0c1030c6bd71ced54bb0ccd836372628b62e3f80"
}

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