Socket
Socket
Sign inDemoInstall

mobservable

Package Overview
Dependencies
Maintainers
1
Versions
79
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobservable - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

4

CHANGELOG.md

@@ -0,1 +1,5 @@

# 1.1.4
* Fixed #65; illegal state exception when using a transaction inside a reactive function. Credits: @kmalakoff
# 1.1.3

@@ -2,0 +6,0 @@

2

lib/dnode.d.ts
export declare function checkIfStateIsBeingModifiedDuringView(context: IContextInfoStruct): void;
export declare function transaction<T>(action: () => T): T;
export declare function transaction<T>(action: () => T, thisArg?: any): T;
export declare function runAfterTransaction(action: () => void): void;

@@ -4,0 +4,0 @@ export declare function untracked<T>(action: () => T): T;

@@ -25,16 +25,13 @@ /**

exports.checkIfStateIsBeingModifiedDuringView = checkIfStateIsBeingModifiedDuringView;
function transaction(action) {
function transaction(action, thisArg) {
inTransaction += 1;
try {
return action();
return action.call(thisArg);
}
finally {
if (--inTransaction === 0) {
var length_1 = changedValues.length;
for (var i = 0; i < length_1; i++)
changedValues[i].markReady(true);
changedValues.splice(0, length_1);
if (changedValues.length)
throw new Error("[mobservable] Illegal State, please file a bug report");
var actions = afterTransactionItems.splice(0, afterTransactionItems.length);
var values = changedValues.splice(0);
for (var i = 0, l = values.length; i < l; i++)
values[i].markReady(true);
var actions = afterTransactionItems.splice(0);
for (var i = 0, l = actions.length; i < l; i++)

@@ -41,0 +38,0 @@ actions[i]();

@@ -12,3 +12,3 @@ import { ViewNode } from './dnode';

protected changeEvent: SimpleEventEmitter;
constructor(func: () => T, scope: Object, context: IContextInfoStruct, compareStructural: any);
constructor(func: () => T, scope: Object, context: IContextInfoStruct, compareStructural: boolean);
get(): T;

@@ -15,0 +15,0 @@ set(x: any): void;

{
"name": "mobservable",
"version": "1.1.3",
"version": "1.1.4",
"description": "Observable data. Reactive functions. Simple code.",

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