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.2 to 1.1.3

4

CHANGELOG.md

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

# 1.1.3
* Fixed #61; if autorun was created during a transaction, postpone execution until the end of the transaction
# 1.1.2

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

@@ -85,5 +85,15 @@ /**

}, mode === ValueMode.Structure);
observable.setRefCount(+1);
var disposedPrematurely = false;
var started = false;
dnode_2.runAfterTransaction(function () {
if (!disposedPrematurely) {
observable.setRefCount(+1);
started = true;
}
});
var disposer = utils_1.once(function () {
observable.setRefCount(-1);
if (started)
observable.setRefCount(-1);
else
disposedPrematurely = true;
});

@@ -90,0 +100,0 @@ disposer.$mobservable = observable;

export declare function checkIfStateIsBeingModifiedDuringView(context: IContextInfoStruct): void;
export declare function transaction<T>(action: () => T): T;
export declare function runAfterTransaction(action: () => void): void;
export declare function untracked<T>(action: () => T): T;

@@ -4,0 +5,0 @@ export declare enum NodeState {

@@ -16,2 +16,3 @@ /**

var changedValues = [];
var afterTransactionItems = [];
var mobservableId = 0;

@@ -38,2 +39,5 @@ function checkIfStateIsBeingModifiedDuringView(context) {

throw new Error("[mobservable] Illegal State, please file a bug report");
var actions = afterTransactionItems.splice(0, afterTransactionItems.length);
for (var i = 0, l = actions.length; i < l; i++)
actions[i]();
}

@@ -43,2 +47,9 @@ }

exports.transaction = transaction;
function runAfterTransaction(action) {
if (inTransaction === 0)
action();
else
afterTransactionItems.push(action);
}
exports.runAfterTransaction = runAfterTransaction;
function untracked(action) {

@@ -45,0 +56,0 @@ try {

2

package.json
{
"name": "mobservable",
"version": "1.1.2",
"version": "1.1.3",
"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