nemo-observable-util
Advanced tools
Comparing version 5.4.0 to 5.4.1
@@ -380,2 +380,19 @@ 'use strict'; | ||
function execSyncAndRunObserverImmediately(fn, opts) { | ||
try { | ||
opts.before(); | ||
var duringStack = transactionManager.duringStack; | ||
var modified = runnerManager.runners.size > 0; | ||
var res = fn(); | ||
if (!duringStack || duringStack && !modified) { | ||
flush(opts.actionName); | ||
} | ||
opts.after(); | ||
return res; | ||
} catch (e) { | ||
opts.after(); | ||
throw e; | ||
} | ||
} | ||
var runnerManager = new RunnerManager(); | ||
@@ -894,4 +911,5 @@ var transactionManager = new StackManager(runnerManager.flush); | ||
exports.asyncAction = asyncAction; | ||
exports.execSyncAndRunObserverImmediately = execSyncAndRunObserverImmediately; | ||
exports.decoratorFactory = decoratorFactory; | ||
exports.isIECompatibleMode = isIECompatibleMode; | ||
exports.wellKnownSymbols = wellKnownSymbols; |
@@ -339,2 +339,19 @@ 'use strict'; | ||
function execSyncAndRunObserverImmediately(fn, opts) { | ||
try { | ||
opts.before(); | ||
const duringStack = transactionManager.duringStack; | ||
const modified = runnerManager.runners.size > 0; | ||
const res = fn(); | ||
if (!duringStack || duringStack && !modified) { | ||
flush(opts.actionName); | ||
} | ||
opts.after(); | ||
return res; | ||
} catch (e) { | ||
opts.after(); | ||
throw e; | ||
} | ||
} | ||
const runnerManager = new RunnerManager(); | ||
@@ -830,4 +847,5 @@ const transactionManager = new StackManager(runnerManager.flush); | ||
exports.asyncAction = asyncAction; | ||
exports.execSyncAndRunObserverImmediately = execSyncAndRunObserverImmediately; | ||
exports.decoratorFactory = decoratorFactory; | ||
exports.isIECompatibleMode = isIECompatibleMode; | ||
exports.wellKnownSymbols = wellKnownSymbols; |
@@ -376,2 +376,19 @@ var connectionStore = new WeakMap(); | ||
function execSyncAndRunObserverImmediately(fn, opts) { | ||
try { | ||
opts.before(); | ||
var duringStack = transactionManager.duringStack; | ||
var modified = runnerManager.runners.size > 0; | ||
var res = fn(); | ||
if (!duringStack || duringStack && !modified) { | ||
flush(opts.actionName); | ||
} | ||
opts.after(); | ||
return res; | ||
} catch (e) { | ||
opts.after(); | ||
throw e; | ||
} | ||
} | ||
var runnerManager = new RunnerManager(); | ||
@@ -875,2 +892,2 @@ var transactionManager = new StackManager(runnerManager.flush); | ||
export { observe, unobserve, observable, isObservable, raw, config, startTransaction, endTransaction, withTransaction, transactionManager, flush, action, actionManager, runInAction, asyncAction, decoratorFactory, isIECompatibleMode, wellKnownSymbols }; | ||
export { observe, unobserve, observable, isObservable, raw, config, startTransaction, endTransaction, withTransaction, transactionManager, flush, action, actionManager, runInAction, asyncAction, execSyncAndRunObserverImmediately, decoratorFactory, isIECompatibleMode, wellKnownSymbols }; |
@@ -335,2 +335,19 @@ const connectionStore = new WeakMap(); | ||
function execSyncAndRunObserverImmediately(fn, opts) { | ||
try { | ||
opts.before(); | ||
const duringStack = transactionManager.duringStack; | ||
const modified = runnerManager.runners.size > 0; | ||
const res = fn(); | ||
if (!duringStack || duringStack && !modified) { | ||
flush(opts.actionName); | ||
} | ||
opts.after(); | ||
return res; | ||
} catch (e) { | ||
opts.after(); | ||
throw e; | ||
} | ||
} | ||
const runnerManager = new RunnerManager(); | ||
@@ -811,2 +828,2 @@ const transactionManager = new StackManager(runnerManager.flush); | ||
export { observe, unobserve, observable, isObservable, raw, config, startTransaction, endTransaction, withTransaction, transactionManager, flush, action, actionManager, runInAction, asyncAction, decoratorFactory, isIECompatibleMode, wellKnownSymbols }; | ||
export { observe, unobserve, observable, isObservable, raw, config, startTransaction, endTransaction, withTransaction, transactionManager, flush, action, actionManager, runInAction, asyncAction, execSyncAndRunObserverImmediately, decoratorFactory, isIECompatibleMode, wellKnownSymbols }; |
{ | ||
"name": "nemo-observable-util", | ||
"version": "5.4.0", | ||
"version": "5.4.1", | ||
"description": "Simple transparent reactivity with 100% language coverage. Made with ES6 Proxies.", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs.es5.js", |
135784
3186