New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jetstate

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jetstate - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

31

index.js

@@ -20,23 +20,16 @@ "use strict";

exports.init = function init(config) {
var name = config.name;
var defaultValue = config.defaultValue;
var willReceive = config.willReceive;
var willUpdate = config.willUpdate;
var didUpdate = config.didUpdate;
var shouldUpdate = config.shouldUpdate;
state.__container__[name] = defaultValue;
Object.defineProperty(state, name, {
get() {
willReceive && willReceive(state.__container__[name]);
return state.__container__[name];
state.__container__[config.name] = config.defaultValue;
Object.defineProperty(state, config.name, {
get: function get() {
config.willReceive && config.willReceive(state.__container__[config.name]);
return state.__container__[config.name];
},
set(value) {
willUpdate && willUpdate(state.__container__[name], value);
if (shouldUpdate)
if (shouldUpdate(state.__container__[name], value) === false) return;
state.__container__[name] = value;
didUpdate && didUpdate(value);
set: function set(value) {
config.willUpdate && config.willUpdate(state.__container__[config.name], value);
if (config.shouldUpdate)
if (config.shouldUpdate(state.__container__[config.name], value) === false) return;
state.__container__[config.name] = value;
config.didUpdate && config.didUpdate(value);
}
})
});
}

@@ -43,0 +36,0 @@

{
"name": "jetstate",
"version": "1.1.0",
"version": "1.1.1",
"description": "state managment",

@@ -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