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

react-localstorage-ts

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-localstorage-ts - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

9

localStorageProxy.d.ts
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",

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