Socket
Socket
Sign inDemoInstall

@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 3.0.0-beta.3 to 3.0.0-beta.4

.rpt2_cache/placeholder/packages/shared/useMutationObserver.d.ts

13

lib/index.browser.cjs.js

@@ -21,12 +21,11 @@ 'use strict';

*/
function useMutationObserver(ref, callback, options) {
if (options === void 0) { options = config; }
react.useEffect(function () {
function useMutationObserver(ref, callback, options = config) {
react.useEffect(() => {
// Create an observer instance linked to the callback function
if (ref.current) {
var observer_1 = new MutationObserver(callback);
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer_1.observe(ref.current, options);
return function () {
observer_1.disconnect();
observer.observe(ref.current, options);
return () => {
observer.disconnect();
};

@@ -33,0 +32,0 @@ }

@@ -19,12 +19,11 @@ import { useEffect } from 'react';

*/
function useMutationObserver(ref, callback, options) {
if (options === void 0) { options = config; }
useEffect(function () {
function useMutationObserver(ref, callback, options = config) {
useEffect(() => {
// Create an observer instance linked to the callback function
if (ref.current) {
var observer_1 = new MutationObserver(callback);
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer_1.observe(ref.current, options);
return function () {
observer_1.disconnect();
observer.observe(ref.current, options);
return () => {
observer.disconnect();
};

@@ -31,0 +30,0 @@ }

@@ -21,12 +21,11 @@ 'use strict';

*/
function useMutationObserver(ref, callback, options) {
if (options === void 0) { options = config; }
react.useEffect(function () {
function useMutationObserver(ref, callback, options = config) {
react.useEffect(() => {
// Create an observer instance linked to the callback function
if (ref.current) {
var observer_1 = new MutationObserver(callback);
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer_1.observe(ref.current, options);
return function () {
observer_1.disconnect();
observer.observe(ref.current, options);
return () => {
observer.disconnect();
};

@@ -33,0 +32,0 @@ }

@@ -19,12 +19,11 @@ import { useEffect } from 'react';

*/
function useMutationObserver(ref, callback, options) {
if (options === void 0) { options = config; }
useEffect(function () {
function useMutationObserver(ref, callback, options = config) {
useEffect(() => {
// Create an observer instance linked to the callback function
if (ref.current) {
var observer_1 = new MutationObserver(callback);
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer_1.observe(ref.current, options);
return function () {
observer_1.disconnect();
observer.observe(ref.current, options);
return () => {
observer.disconnect();
};

@@ -31,0 +30,0 @@ }

@@ -23,12 +23,11 @@ (function (global, factory) {

*/
function useMutationObserver(ref, callback, options) {
if (options === void 0) { options = config; }
react.useEffect(function () {
function useMutationObserver(ref, callback, options = config) {
react.useEffect(() => {
// Create an observer instance linked to the callback function
if (ref.current) {
var observer_1 = new MutationObserver(callback);
const observer = new MutationObserver(callback);
// Start observing the target node for configured mutations
observer_1.observe(ref.current, options);
return function () {
observer_1.disconnect();
observer.observe(ref.current, options);
return () => {
observer.disconnect();
};

@@ -35,0 +34,0 @@ }

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

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e=e||self).useMutationObserver=t(e.React)}(this,function(e){"use strict";var t={attributes:!0,characterData:!0,subtree:!0,childList:!0};return function(r,n,u){void 0===u&&(u=t),e.useEffect(function(){if(r.current){var e=new MutationObserver(n);return e.observe(r.current,u),function(){e.disconnect()}}},[r.current,n,u])}});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define(["react"],t):(e=e||self).useMutationObserver=t(e.React)}(this,function(e){"use strict";var t={attributes:!0,characterData:!0,subtree:!0,childList:!0};return function(r,n,u=t){e.useEffect(()=>{if(r.current){const e=new MutationObserver(n);return e.observe(r.current,u),()=>{e.disconnect()}}},[r.current,n,u])}});
//# sourceMappingURL=index.min.js.map

@@ -34,3 +34,3 @@ {

],
"version": "3.0.0-beta.3",
"version": "3.0.0-beta.4",
"_id": "@rooks/use-mutation-observer@",

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

},
"gitHead": "0469063d73207867117f0ae67c4d5a3f88f0ed7b"
"gitHead": "380c23550a5c5ac1b147986ec2c6e3b6077e9c57"
}
{
"extends": "../tsconfig.settings.json",
"compilerOptions": {
"rootDir": "../../",
"rootDir": "src",
"outDir": "lib",
"types": ["../../node_modules/shared/useMutationObserver"]
"baseUrl": "../../",
"declarationDir": "lib",
"paths": {
"shared/*": ["../shared/*"]
}
},
"include": ["node_modules/shared/*.ts"],
"references": [

@@ -9,0 +14,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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