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

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 0.3.2 to 0.3.3

9

dist/mobservable.js

@@ -74,4 +74,9 @@ /**

};
mobservableStatic.toJSON = function toJSON(value) {
if (value instanceof ObservableArray)
return value.values();
return value;
};
mobservableStatic.batch = function batch(action) {
Scheduler.batch(action);
return Scheduler.batch(action);
};

@@ -688,3 +693,3 @@ mobservableStatic.onReady = function onReady(listener) {

try {
action();
return action();
}

@@ -691,0 +696,0 @@ finally {

@@ -16,6 +16,8 @@ declare module "mobservable" {

export function toJSON<T>(any:T):T;
// annotation
export function observable(target:Object, key:string);
export function batch(action:Lambda);
export function batch<T>(action:()=>T):T;
export function onReady(listener:Lambda):Lambda;

@@ -22,0 +24,0 @@ export function onceReady(listener:Lambda);

@@ -25,3 +25,5 @@ /**

watch<T>(func:()=>T, onInvalidate:Lambda):[T,Lambda];
toJSON<T>(any:T):T;
// property definition

@@ -34,3 +36,3 @@ observable(target:Object, key:string); // annotation

// batching
batch(action:Lambda);
batch<T>(action:()=>T):T;
onReady(listener:Lambda):Lambda;

@@ -150,6 +152,13 @@ onceReady(listener:Lambda);

mobservableStatic.batch = function batch(action:Lambda) {
Scheduler.batch(action);
mobservableStatic.toJSON = function toJSON<T>(value:T):T {
if (value instanceof ObservableArray)
return (<any>value).values();
// later on, more cases like objects and such
return value;
}
mobservableStatic.batch = function batch<T>(action:()=>T):T {
return Scheduler.batch(action);
}
mobservableStatic.onReady = function onReady(listener:Lambda):Lambda {

@@ -842,6 +851,6 @@ return Scheduler.onReady(listener);

static batch(action:Lambda) {
static batch<T>(action:()=>T):T {
Scheduler.inBatch += 1;
try {
action();
return action();
} finally {

@@ -848,0 +857,0 @@ //Scheduler.inBatch -= 1;

{
"name": "mobservable",
"version": "0.3.2",
"version": "0.3.3",
"description": "Changes are coming! Small library for creating observable properties en functions",

@@ -5,0 +5,0 @@ "main": "dist/mobservable.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