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

proxy-state-tree

Package Overview
Dependencies
Maintainers
1
Versions
865
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

proxy-state-tree - npm Package Compare versions

Comparing version 1.0.0-1535047853450 to 1.0.0-1535059157240

16

es/index.js
import proxify, { IS_PROXY, STATUS } from './proxify';
const isPlainObject = require('is-plain-object');
class ProxyStateTree {
constructor(state, options = {}) {
let stateObject = {};
try {
stateObject = Object.keys(state).reduce((aggr, key) => {
aggr[key] = state[key];
return aggr;
}, {});
if (!isPlainObject(state)) {
throw new Error('You did not pass a plain object as state to Proxy State Tree');
}
catch (e) {
console.warn('You passed a non-object value to Proxy State Tree ');
}
if (typeof options.devmode === 'undefined') {
options.devmode = true;
}
this.state = stateObject;
this.state = state;
this.options = options;

@@ -26,3 +20,3 @@ this.pathDependencies = {};

this.status = STATUS.IDLE;
this.proxy = proxify(this, stateObject);
this.proxy = proxify(this, state);
this.currentFlushId = 0;

@@ -29,0 +23,0 @@ }

@@ -5,18 +5,12 @@ "use strict";

exports.IS_PROXY = proxify_1.IS_PROXY;
const isPlainObject = require('is-plain-object');
class ProxyStateTree {
constructor(state, options = {}) {
let stateObject = {};
try {
stateObject = Object.keys(state).reduce((aggr, key) => {
aggr[key] = state[key];
return aggr;
}, {});
if (!isPlainObject(state)) {
throw new Error('You did not pass a plain object as state to Proxy State Tree');
}
catch (e) {
console.warn('You passed a non-object value to Proxy State Tree ');
}
if (typeof options.devmode === 'undefined') {
options.devmode = true;
}
this.state = stateObject;
this.state = state;
this.options = options;

@@ -30,3 +24,3 @@ this.pathDependencies = {};

this.status = proxify_1.STATUS.IDLE;
this.proxy = proxify_1.default(this, stateObject);
this.proxy = proxify_1.default(this, state);
this.currentFlushId = 0;

@@ -33,0 +27,0 @@ }

{
"name": "proxy-state-tree",
"version": "1.0.0-1535047853450",
"version": "1.0.0-1535059157240",
"description": "An implementation of the Mobx/Vue state tracking approach, for library authors",

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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