Socket
Socket
Sign inDemoInstall

simpler-state

Package Overview
Dependencies
Maintainers
1
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simpler-state - npm Package Compare versions

Comparing version 2.0.0-pre.7 to 2.0.0-rc.1

20

es/tools/inspector.js

@@ -37,3 +37,3 @@ import _extends from "@babel/runtime/helpers/esm/extends";

function handleDevToolsEvent(event) {
if (!isInspectorEnabled) return;
if (!isInspectorEnabled || !devTools) return;

@@ -68,2 +68,18 @@ if (event.type === 'DISPATCH') {

case 'IMPORT_STATE':
{
var _imported$computedSta;
const {
nextLiftedState: imported
} = event.payload;
if (!imported || !imported.computedStates) return;
const currentIndex = imported.currentStateIndex ?? imported.computedStates.length - 1;
const currentState = (_imported$computedSta = imported.computedStates[currentIndex]) == null ? void 0 : _imported$computedSta.state;
if (typeof currentState !== 'object') return;
updateRegistry(currentState);
devTools.send(null, imported);
return;
}
case 'PAUSE_RECORDING':

@@ -85,3 +101,3 @@ isDevToolsPaused = !isDevToolsPaused;

if (parsedState === undefined) return;
if (typeof parsedState !== 'object') return;
updateRegistry(parsedState);

@@ -88,0 +104,0 @@ return parsedState;

@@ -58,3 +58,3 @@ "use strict";

function handleDevToolsEvent(event) {
if (!isInspectorEnabled) return;
if (!isInspectorEnabled || !devTools) return;

@@ -89,2 +89,16 @@ if (event.type === 'DISPATCH') {

case 'IMPORT_STATE':
{
var _imported$currentStat, _imported$computedSta;
var imported = event.payload.nextLiftedState;
if (!imported || !imported.computedStates) return;
var currentIndex = (_imported$currentStat = imported.currentStateIndex) != null ? _imported$currentStat : imported.computedStates.length - 1;
var currentState = (_imported$computedSta = imported.computedStates[currentIndex]) == null ? void 0 : _imported$computedSta.state;
if (typeof currentState !== 'object') return;
(0, _registry.updateRegistry)(currentState);
devTools.send(null, imported);
return;
}
case 'PAUSE_RECORDING':

@@ -106,3 +120,3 @@ isDevToolsPaused = !isDevToolsPaused;

if (parsedState === undefined) return;
if (typeof parsedState !== 'object') return;
(0, _registry.updateRegistry)(parsedState);

@@ -109,0 +123,0 @@ return parsedState;

2

package.json
{
"name": "simpler-state",
"version": "2.0.0-pre.7",
"version": "2.0.0-rc.1",
"description": "The simplest app state management for React",

@@ -5,0 +5,0 @@ "keywords": [

@@ -7,2 +7,8 @@ import type { MutableMap } from './registry';

type: string;
nextLiftedState?: {
computedStates: {
state: any;
}[];
currentStateIndex?: number;
};
[P: string]: any;

@@ -19,3 +25,3 @@ };

type: string;
}, state: MutableMap): void;
} | null, state: MutableMap): void;
subscribe(callback: (event: DevToolsEvent) => void): void;

@@ -22,0 +28,0 @@ }

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