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.1.0-alpha.0 to 1.1.0

lib/index.browser.cjs.js

17

lib/index.js

@@ -1,3 +0,14 @@

"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])};
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
typeof define === 'function' && define.amd ? define(['react'], factory) :
(global = global || self, global.useMutationObserver = factory(global.React));
}(this, function (react) { 'use strict';
var config={attributes:!0,characterData:!0,subtree:!0,childList:!0};function useMutationObserver(a,b){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:config;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]);}
return useMutationObserver;
}));
//# sourceMappingURL=index.js.map

8

package.json
{
"main": "lib/index.js",
"jsnext:main": "lib/index.esm.js",
"module": "lib/index.esm.js",
"license": "MIT",

@@ -14,3 +16,3 @@ "description": "A React Hooks package for mutation-observer",

"lint": "eslint src test",
"build": "babel src --out-dir lib",
"build": "rollup -c ../../scripts/rollup.config.js",
"prepublish": "yarn run build"

@@ -28,3 +30,3 @@ },

],
"version": "1.1.0-alpha.0",
"version": "1.1.0",
"_id": "@rooks/use-mutation-observer@",

@@ -38,3 +40,3 @@ "publishConfig": {

},
"gitHead": "b094c85097d25a6f9587e4a9bb4f5cb302520951"
"gitHead": "ace085776674cf83a285739385b6a9be7bfb34c5"
}
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