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

cerebral

Package Overview
Dependencies
Maintainers
1
Versions
638
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cerebral - npm Package Compare versions

Comparing version 0.20.10 to 0.20.11

2

package.json
{
"name": "cerebral",
"version": "0.20.10",
"version": "0.20.11",
"description": "A state controller with its own debugger",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -12,16 +12,4 @@ /*

// We grab the signals stored in localStorage, if any
var signals = utils.hasLocalStorage() && localStorage.getItem('cerebral_signals') ?
JSON.parse(localStorage.getItem('cerebral_signals')) : [];
// Indicates if signals should be stored or replaced. Grabs from localStorage if available
var willKeepState = (
typeof process !== 'undefined' && process.env.NODE_ENV === 'production' ?
false :
utils.hasLocalStorage() && localStorage.getItem('cerebral_willKeepState') ?
JSON.parse(localStorage.getItem('cerebral_willKeepState')) :
true
);
var signals = [];
var willKeepState = false;
var executingAsyncActionsCount = 0;

@@ -178,2 +166,6 @@ var isRemembering = false;

setSignals: function (newSignals) {
signals = signals.concat(newSignals);
},
isExecutingAsync: function () {

@@ -180,0 +172,0 @@ return !!executingAsyncActionsCount;

@@ -33,2 +33,13 @@ var utils = require('./utils.js');

var signals = utils.hasLocalStorage() && localStorage.getItem('cerebral_signals') ?
JSON.parse(localStorage.getItem('cerebral_signals')) : [];
var willKeepState = utils.hasLocalStorage() && localStorage.getItem('cerebral_willKeepState') ?
JSON.parse(localStorage.getItem('cerebral_willKeepState')) :
true;
if (willKeepState) {
signalStore.toggleKeepState();
}
isInitialized = true;

@@ -42,2 +53,3 @@

});
signalStore.setSignals(signals);
signalStore.remember(signalStore.getSignals().length - 1);

@@ -50,2 +62,3 @@ window.dispatchEvent(event);

});
signalStore.setSignals(signals);
signalStore.rememberInitial(signalStore.getSignals().length - 1);

@@ -99,3 +112,5 @@ window.dispatchEvent(event);

window.addEventListener('unload', function () {
signalStore.removeRunningSignals();
utils.hasLocalStorage() && localStorage.setItem('cerebral_signals', isInitialized && signalStore.willKeepState() ? JSON.stringify(signalStore.getSignals()) : JSON.stringify([]));

@@ -102,0 +117,0 @@ utils.hasLocalStorage() && localStorage.setItem('cerebral_willKeepState', isInitialized && JSON.stringify(signalStore.willKeepState()));

@@ -54,5 +54,3 @@ var CreateSignalFactory = require('./CreateSignalFactory.js');

controller.devtools.start();
return controller;
};
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