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.2.2 to 1.3.0

25

index.js

@@ -1,6 +0,6 @@

"use strict";
'use strict';
exports.__esModule = true;
var state = {
__container__: {},
__container__: {}
};

@@ -11,6 +11,6 @@

* @public
* @version 1.2.0
* @param {object} config
* @version 1.3.0
* @param {object} config
* @param {string} config.name name state
* @param {any} config.defaultValue default value
* @param {any} config.defaultValue default value
* @param {function} config.willUpdate function for before set state

@@ -24,9 +24,14 @@ * @param {function} config.shouldUpdate function for is need update

Object.defineProperty(state, config.name, {
get: function get() {
get: function get() {
return state.__container__[config.name];
},
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;
if (
config.shouldUpdate(state.__container__[config.name], value) === false
)
return;
config.willUpdate &&
config.willUpdate(state.__container__[config.name], value);
state.__container__[config.name] = value;

@@ -36,3 +41,3 @@ config.didUpdate && config.didUpdate(value);

});
}
};

@@ -44,2 +49,2 @@ /**

*/
exports.state = state;
exports.state = state;

2

package.json
{
"name": "jetstate",
"version": "1.2.2",
"version": "1.3.0",
"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