You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@mui/toolpad-utils

Package Overview
Dependencies
Maintainers
3
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mui/toolpad-utils - npm Package Compare versions

Comparing version

to
0.1.45

25

dist/hooks/useStorageState.js

@@ -8,32 +8,17 @@ import {

var emitter = new Emitter();
var cache = /* @__PURE__ */ new Map();
function subscribe(area, key, cb) {
const onKeyChange = () => {
cache.delete(key);
cb();
};
const storageHandler = (event) => {
if (event.storageArea === area && event.key === key) {
onKeyChange();
cb();
}
};
window.addEventListener("storage", storageHandler);
emitter.on(key, onKeyChange);
emitter.on(key, cb);
return () => {
window.removeEventListener("storage", storageHandler);
emitter.off(key, onKeyChange);
emitter.off(key, cb);
};
}
function getSnapshot(area, key) {
let value = cache.get(key) ?? null;
if (!value) {
const item = area.getItem(key);
value = item;
if (value === null) {
cache.delete(key);
} else {
cache.set(key, value);
}
}
return value;
return area.getItem(key);
}

@@ -43,6 +28,4 @@ function setValue(area, key, value) {

if (value === null) {
cache.delete(key);
area.removeItem(key);
} else {
cache.set(key, value);
area.setItem(key, String(value));

@@ -49,0 +32,0 @@ }

6

package.json
{
"name": "@mui/toolpad-utils",
"version": "0.1.44",
"version": "0.1.45",
"description": "Build MUI apps quickly",

@@ -65,7 +65,7 @@ "author": "MUI Toolpad team",

"@types/prettier": "2.7.3",
"@types/react": "18.2.46",
"@types/react": "18.2.47",
"@types/react-is": "18.2.4",
"@types/title": "3.4.3"
},
"gitHead": "2fe722be5e3fbcc44e11a29e1490c348f518fa6c"
"gitHead": "d1e2743334d036a98c9a0867404f3fbcf70f6e43"
}

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