react-localstorage-ts
Advanced tools
Comparing version 1.0.2 to 1.0.3
import { StoredItem } from "./useLocalStorage"; | ||
export declare function localStorageAvailable(): boolean; | ||
export declare class LocalStorageChangedEvent extends CustomEvent<{ | ||
key: StoredItem; | ||
}> { | ||
static eventName: string; | ||
constructor(key: StoredItem); | ||
export interface LocalStorageChangedEvent { | ||
detail: { | ||
key: StoredItem; | ||
}; | ||
} | ||
@@ -9,0 +8,0 @@ export declare const isLocalStorageEvent: (e: any) => e is LocalStorageChangedEvent; |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.localStorageProxy = exports.MemoryStorageProxy = exports.LocalStorageProxy = exports.isLocalStorageEvent = exports.LocalStorageChangedEvent = exports.localStorageAvailable = void 0; | ||
exports.localStorageProxy = exports.MemoryStorageProxy = exports.LocalStorageProxy = exports.isLocalStorageEvent = exports.localStorageAvailable = void 0; | ||
function localStorageAvailable() { | ||
@@ -41,17 +28,12 @@ try { | ||
exports.localStorageAvailable = localStorageAvailable; | ||
var LocalStorageChangedEvent = /** @class */ (function (_super) { | ||
__extends(LocalStorageChangedEvent, _super); | ||
function LocalStorageChangedEvent(key) { | ||
return _super.call(this, LocalStorageChangedEvent.eventName, { detail: { key: key } }) || this; | ||
} | ||
LocalStorageChangedEvent.eventName = "onLocalStorageChange"; | ||
return LocalStorageChangedEvent; | ||
}(CustomEvent)); | ||
exports.LocalStorageChangedEvent = LocalStorageChangedEvent; | ||
var createLocalStorageChangedEvent = function (key) { | ||
return new CustomEvent("onLocalStorageChange", { detail: { key: key } }); | ||
}; | ||
var isLocalStorageEvent = function (e) { | ||
return e instanceof LocalStorageChangedEvent; | ||
var _a; | ||
return typeof ((_a = e === null || e === void 0 ? void 0 : e.detail) === null || _a === void 0 ? void 0 : _a.key) === "string"; | ||
}; | ||
exports.isLocalStorageEvent = isLocalStorageEvent; | ||
var dispatchCustomEvent = function (key) { | ||
return window.dispatchEvent(new LocalStorageChangedEvent(key)); | ||
return window.dispatchEvent(createLocalStorageChangedEvent(key)); | ||
}; | ||
@@ -58,0 +40,0 @@ var LocalStorageProxy = /** @class */ (function () { |
{ | ||
"name": "react-localstorage-ts", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A small library to wrap browser's localstorage in a functional fashion.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
19275
405