New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

immview

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immview - npm Package Compare versions

Comparing version 2.0.9 to 2.0.10

diag_preview/diagdemo.js

25

changelog.md

@@ -1,17 +0,16 @@

#Changelog
# Changelog
## 2.0.0
- feat: **Immview** is now written with TypeScript and exposes types declarations
- feat: `Dispatcher` and by that `Domain` actions and `Data` writes return promises of these being executed
- feat: `Observable`s are first class citizens of the library, not implementation detail and follows TC39 Observable proposal as closely as possible and in most usable way https://github.com/tc39/proposal-observable
- feat: `Observable::subscribe` callback will not be immediately called with last shared value
- feat: `View` functionality will be achievable using `Observable::map` function only
- feat: `Scan` functionality will be achievable using `Observable::scan` function only
- feat: `Reduce` functionality will be achievable using `Observable::reduce` function only
- feat: `Debounce` functionality will be achievable using `Observable::debounce` function only
- feat: `Throttle` functionality will be achievable using `Observable::throttle` function only
- feat: `Observable::buffer` function is introduced. Observables next stream values pressure unloading by replacing awaiting values caused by previous implementation of `Dispatcher` will no longer be.
- feat: `Domain` with actions can now be created through factory `Domain.create`
- feat: Adding actions while extending `Domain` class can be achieved through `@action` decorator
- feat: **Immview** is now written with TypeScript and exposes types declarations.
- feat: `Domain` actions return promises of these being executed.
- feat: `Observable` is a first class citizen of the library, not an implementation detail and follows [TC39 Observable proposal](https://github.com/tc39/proposal-observable) as closely as possible and in most usable way.
- feat: `Observable::subscribe` callback will not be immediately called with last shared value.
- feat: `Data` is achievable through normal `Observable` creation and pushing values. All `Observable`s are observers (actually all observer's proxy) and can push messages even if are derivative to some other stream..
- feat: `View` functionality will be achievable using `Observable::map` function only.
- feat: `Scan` functionality will be achievable using `Observable::scan` function only.
- feat: `Merge` is renamed to `Combine`.
- feat: `Observable::buffer*` functions are introduced. `Observable`s stream pressure unloading by replacing awaiting values will no longer be.
- feat: `Domain` with actions can now be created through factory `Domain.create`.
- feat: Adding actions while extending `Domain` class can be achieved through `@action` decorator (experimental feature).

@@ -18,0 +17,0 @@ ---

@@ -39,3 +39,3 @@ import { Subscription } from './Subscription';

start(): void;
next(value: NextStep<T>): void;
next(nextValue: NextStep<T>): void;
error(error: Error): void;

@@ -42,0 +42,0 @@ complete(): void;

@@ -8,2 +8,3 @@ export interface Task {

readonly isRunning: boolean;
private subsequentCalls;
tasks: Task[];

@@ -13,4 +14,5 @@ push(execute: () => any, priority: any): Dispatcher;

loop(): void;
tooManyCalls(): void;
private findNextTask();
next(job: () => void, next: () => void): void;
}

@@ -6,2 +6,2 @@ import { Dispatcher } from './Dispatcher';

declare const dispatchPromise: (job: () => any, priority: DispatcherPriorities) => Promise<void>;
export { DispatcherInstance as Dispatcher, dispatch, dispatchPromise };
export { DispatcherInstance as dispatcher, dispatch, dispatchPromise };

@@ -6,3 +6,4 @@ export declare enum DispatcherPriorities {

EXTERNAL = 4,
DIAGNOSE = 5,
TEST = 10,
}

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.immview=e():t.immview=e()}(this,function(){return function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var n=r(1);e.Dispatcher=n.Dispatcher;var i=r(2),o=r(3);e.Observable=o.Observable;var s=r(5);e.Combine=s.Combine,e.Merge=s.Combine;var u=r(8);e.Domain=u.Domain;var c=r(7);e.action=c.action;var a=function(t){n.Dispatcher.push(t,i.DispatcherPriorities.EXTERNAL)};e.dispatch=a},function(t,e,r){"use strict";var n=r(6),i=new n.Dispatcher;e.Dispatcher=i;var o=function(t,e){i.push(t,e),i.run()};e.dispatch=o;var s=function(t,e){return new Promise(function(r,n){o(function(){try{r(t())}catch(t){console.error(t.stack||t.message||t),n(t)}},e)})};e.dispatchPromise=s},function(t,e){"use strict";var r;!function(t){t[t.OBSERVABLE=1]="OBSERVABLE",t[t.DOMAIN=2]="DOMAIN",t[t.BUFFER=3]="BUFFER",t[t.EXTERNAL=4]="EXTERNAL",t[t.TEST=10]="TEST"}(r=e.DispatcherPriorities||(e.DispatcherPriorities={}))},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=r(4),o=r(2),s=r(1),u="undefined"!=typeof Symbol?Symbol("ObservableSymbol"):"ObservableSymbol",c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.of=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];return e.from(t)},e.from=function(t){if(t[u])return new e(function(e){t[u]().subscribe(e.next,e.error,e.complete)});if(t[Symbol.iterator])return new e(function(e){for(var r=e.next,n=e.error,i=e.complete,o=t[Symbol.iterator](),s=o.next();s.done===!1;s=o.next())s.value instanceof Error?n(s.value):r(s.value);i()});throw Error("Observable.from incorrect input")},e.prototype.map=function(t){var r=this;return new e(function(e){var n=r.subscribe(function(r){try{e.next(t(r))}catch(t){e.error(t)}},e.error,e.complete);return function(){return n.unsubscribe()}})},e.prototype.flatten=function(){var t=this;return new e(function(e){t.subscribe(function(t){t&&t.subscribe(function(t){e.next(t)},function(t){return e.error(t)})},e.error,e.complete)})},e.prototype.scan=function(t){var r=this;return new e(function(e){var n,i=0,o=r.subscribe(function(r){try{n=t(n,r,i++),e.next(n)}catch(t){e.error(t)}},e.error,e.complete);return function(){return o.unsubscribe()}})},e.prototype.filter=function(t){var r=this;return new e(function(e){var n=r.subscribe(function(r){try{t(r)&&e.next(r)}catch(t){e.error(t)}},e.error,e.complete);return function(){return n.unsubscribe()}})},e.prototype.merge=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];var n=0,i=new e,o={start:function(){},next:function(t){i.next(t)},error:function(t){i.error(t)},complete:function(){n++,n===t.length+1&&i.complete()}};return this.subscribe(o),t.forEach(function(t){return t.subscribe(o)}),i},e.prototype.bufferCount=function(t,r){var n=this;void 0===r&&(r=null);var i=r||t,o=[];return new e(function(e){var r=n.subscribe(function(r){o.push(r),o.length===t&&(e.next(o.slice()),o=o.splice(i,t-i))},e.error,function(){o.length>t-i&&e.next(o.slice()),e.complete()});return function(){return r.unsubscribe()}})},e.prototype.buffer=function(t){var r=this;void 0===t&&(t=0);var n=[];return new e(function(e){var i=r.subscribe(function(r){n=t>0?[r].concat(n).splice(0,t):[r].concat(n),s.Dispatcher.push(function(){0!==n.length&&e.next(n.splice(0).reverse())},o.DispatcherPriorities.BUFFER).run()},e.error,function(){n.length>0&&e.next(n.splice(0).reverse()),e.complete()});return function(){return i.unsubscribe()}})},e}(i.BaseObservable);e.Observable=c,c.prototype[u]=function(){return this}},function(t,e,r){"use strict";var n,i=r(1),o=r(2),s=r(9);!function(t){t[t.Next=0]="Next",t[t.Error=1]="Error",t[t.Complete=2]="Complete"}(n=e.MessageTypes||(e.MessageTypes={}));var u=function(){},c=function(){function t(e){var r=this;this.closed=!1;var i=this;return this.observers=[],this.priority=t.lastObservablePriority++,e?void(this.cancelSubscriber=e({next:function(t){r.pushMessage([n.Next,"function"==typeof t?t:function(){return t},u])},error:function(t){r.pushMessage([n.Error,t,u])},complete:function(){r.pushMessage([n.Complete,,u])},get closed(){return i.observers.length>0}})||u):void(this.cancelSubscriber=u)}return t.prototype.previous=function(){return this.lastValue},t.prototype.start=function(){},t.prototype.next=function(t){this.pushMessage([n.Next,"function"==typeof t?t:function(){return t},u])},t.prototype.error=function(t){this.pushMessage([n.Error,t,u])},t.prototype.complete=function(){this.pushMessage([n.Complete,,u])},t.prototype.subscribe=function(){for(var e=this,r=[],n=0;arguments.length>n;n++)r[n]=arguments[n];if(this.closed)return new s.Subscription(null,function(){return!1});if("object"!=typeof r[0]||null===r[0]){var i=r[0],o=void 0===i?u:i,c=r[1],a=void 0===c?u:c,f=r[2],p=void 0===f?u:f;return this.subscribe({start:u,next:o,error:a,complete:p})}var l=r[0];this.observers.push(l);var h=new s.Subscription(function(){e.observers=e.observers.filter(function(t){return t!==l})},function(){return e.observers.indexOf(l)>-1});return l.start(h),t.dispatchDigestMessages(),h},t.prototype.pushMessage=function(e){this.closed||(t.awaitingMessages.push([this,e]),t.dispatchDigestMessages())},t.dispatchDigestMessages=function(){i.dispatch(t.digestAwaitingMessages,o.DispatcherPriorities.OBSERVABLE)},t.digestAwaitingMessages=function(){var e=t.popMessage(),r=e[0],n=e[1];r&&!r.closed&&(t.digestNodeMessage(r,n),t.dispatchDigestMessages())},t.popMessage=function(){if(0===t.awaitingMessages.length)return[null,null];for(var e=0;t.awaitingMessages.length>e;e++){var r=t.awaitingMessages[e],n=r[0],i=void 0===n?null:n,o=r[1];if(i.observers.length)return t.awaitingMessages.splice(e,1),[i,o]}return[null,null]},t.digestNodeMessage=function(t,e){var r=e[0],s=e[2];if(r===n.Next){var c=e,a=c[1],f=a(t.lastValue);t.lastValue=f,t.observers.forEach(function(t){return t.next(f)})}else if(r===n.Error){var p=e,l=p[1];t.observers.forEach(function(t){return t.error(l)})}else r===n.Complete&&(t.cancelSubscriber(),t.cancelSubscriber=u,t.closed=!0,t.observers.splice(0).forEach(function(t){return t.complete()}));i.dispatch(s,o.DispatcherPriorities.OBSERVABLE)},t}();c.awaitingMessages=[],c.lastObservablePriority=0,e.BaseObservable=c},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;n>r;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},o=r(3),s=function(t){function e(e){return t.call(this,function(t){var r=[],n=[],o=[],s={},u=[],c=function(c){return Object.prototype.hasOwnProperty.call(e,c)?(r.push(c),void u.push(e[c].subscribe(function(e){if(o&&o.push([c,e]),n.indexOf(c)<0&&n.push(c),r.length===n.length){if(o){for(var u={},a=[],f=[],p=0;o.length>p;p++)if(a.indexOf(o[p][0])<0){var l=o[p],h=l[0],v=l[1];u[h]=v,a.push(h)}else f.push(o[p]);return t.next(s=u),f.forEach(function(e){var r=e[0],n=e[1];t.next(s=i({},s,(o={},o[r]=n,o)));var o}),void(o=null)}t.next(s=i({},s,(b={},b[c]=e,b)));var b}}))):"continue"};for(var a in e)c(a);return function(){u.forEach(function(t){return t()})}})||this}return n(e,t),e}(o.Observable);e.Combine=s},function(t,e){"use strict";var r=function(){function t(){this._isRunning=!1,this.tasks=[]}return Object.defineProperty(t.prototype,"isRunning",{get:function(){return!!this._isRunning},enumerable:!0,configurable:!0}),t.prototype.push=function(t,e){return this.tasks.push({priority:e,execute:t}),this},t.prototype.run=function(){var t=this;this._isRunning||(this._isRunning=!0,Promise.resolve().then(function(){return t.loop()}))},t.prototype.loop=function(){var t=this,e=this.findNextTask();return e?void this.next(e.execute,function(){Promise.resolve().then(function(){return t.loop()})}):void(this._isRunning=!1)},t.prototype.findNextTask=function(){for(var t=null,e=0;this.tasks.length>e;e++)(null===t||this.tasks[t].priority>this.tasks[e].priority)&&(t=e);return null===t?null:this.tasks.splice(t,1)[0]},t.prototype.next=function(t,e){try{t()}catch(t){console.error(t.stack||t.message||t)}e()},t}();e.Dispatcher=r},function(t,e,r){"use strict";function n(t,e,r){var n=r.value;r.value=function(){for(var t=this,e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];return o.dispatchPromise(function(){n.apply(t,e)},i.DispatcherPriorities.DOMAIN)}}var i=r(2),o=r(1);e.action=n},function(t,e,r){"use strict";var n=this&&this.__extends||function(t,e){function r(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)},i=this&&this.__assign||Object.assign||function(t){for(var e,r=1,n=arguments.length;n>r;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},o=r(3),s=r(2),u=r(1),c=function(t){function e(e){var r=this;return e?r=t.call(this,function(t){e.subscribe(i({},t,{start:function(){}}))})||this:void(r=t.call(this)||this)}return n(e,t),e.tagged=function(t){for(var r=[],n=1;arguments.length>n;n++)r[n-1]=arguments[n];var i=function(){for(var n=[],i=0;arguments.length>i;i++)n[i]=arguments[i];var o=e.create.apply(void 0,n);return o.name=t.reduce(function(t,e,n){return t+(n>0?r[n-1]:"")+e}),o};return i},e.create=function(){for(var t=[],r=0;arguments.length>r;r++)t[r]=arguments[r];var n,i,o;"object"==typeof t[0]&&null!==t[0]&&"function"==typeof t[0].subscribe&&(n=t.shift()),i=t.shift(),o=t.shift();var c=new e(n);if(i){var a=function(t){return Object.prototype.hasOwnProperty.call(i,t)?void(c[t]=function(){for(var e=[],r=0;arguments.length>r;r++)e[r]=arguments[r];return u.dispatchPromise((n=i[t]).bind.apply(n,[c].concat(e)),s.DispatcherPriorities.DOMAIN);var n}):"continue"};for(var f in i)a(f)}if(o)for(var p in o)Object.prototype.hasOwnProperty.call(o,p)&&(c[p]=o[p]);return c},e}(o.Observable);e.Domain=c},function(t,e){"use strict";var r=function(){function t(t,e){this.customUnsubscribe=t,this.isSubscriptionActive=e}return Object.defineProperty(t.prototype,"closed",{get:function(){return!this.isSubscriptionActive()},enumerable:!0,configurable:!0}),t.prototype.unsubscribe=function(){var t=this.customUnsubscribe;t&&(this.customUnsubscribe=null,t&&t())},t}();e.Subscription=r}])});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.immview=e():t.immview=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";var r=n(1);e.dispatcher=r.dispatcher;var i=n(2),o=n(4);e.Observable=o.Observable;var s=n(6);e.Combine=s.Combine,e.Merge=s.Combine;var u=n(9);e.Domain=u.Domain;var c=n(8);e.action=c.action;var a=n(3);e.diagnose=a.diagnose;var f=function(t){r.dispatcher.push(t,i.DispatcherPriorities.EXTERNAL)};e.dispatch=f},function(t,e,n){"use strict";var r=n(7),i=new r.Dispatcher;e.dispatcher=i;var o=function(t,e){i.push(t,e),i.run()};e.dispatch=o;var s=function(t,e){return new Promise(function(n,r){var i,s,u;o(function(){try{s=t(),i=!0}catch(t){u=t,i=!1}},e),o(function(){i?n(s):r(u)},e)})};e.dispatchPromise=s},function(t,e){"use strict";var n;!function(t){t[t.OBSERVABLE=1]="OBSERVABLE",t[t.DOMAIN=2]="DOMAIN",t[t.BUFFER=3]="BUFFER",t[t.EXTERNAL=4]="EXTERNAL",t[t.DIAGNOSE=5]="DIAGNOSE",t[t.TEST=10]="TEST"}(n=e.DispatcherPriorities||(e.DispatcherPriorities={}))},function(t,e,n){"use strict";var r=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},i=n(1),o=n(2),s=function(){function t(){this.list=null,this.tableIsRequested=!1}return Object.defineProperty(t.prototype,"isOn",{get:function(){return void 0!==this.list},enumerable:!0,configurable:!0}),t.prototype.on=function(){window.performance&&(this.list=[])},t.prototype.off=function(){this.list=null},t.prototype.measure=function(t){var e=this;if(this.list){this.tableIsRequested||(this.tableIsRequested=!0,i.dispatch(function(){e.tableIsRequested=!1,console.table(e.list.splice(0).reduce(function(t,e){for(var n=function(n){if(n["action name"]===e["action name"])return{value:t.filter(function(t){return t!==n}).concat([r({},n,{"action duration in ms":n["action duration in ms"]+e["action duration in ms"],occurences:n.occurences+1})])}},i=0,o=t;o.length>i;i++){var s=o[i],u=n(s);if("object"==typeof u)return u.value}return t.concat([r({},e,{occurences:1})])},[]))},o.DispatcherPriorities.DOMAIN)),window.performance.mark(t+"_start");var n=window.performance.now();return function(){e.list.push({"action name":t,"action duration in ms":window.performance.now()-n}),window.performance.mark(t+"_end"),window.performance.measure(t,t+"_start",t+"_end")}}},t}();e.Diagnose=s,e.diagnose=new s},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(5),o=n(2),s=n(1),u=n(3),c="undefined"!=typeof Symbol?Symbol("ObservableSymbol"):"ObservableSymbol",a=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.of=function(){for(var t=[],n=0;arguments.length>n;n++)t[n]=arguments[n];return e.from(t)},e.from=function(t){if(t[c]){var n=t[c](),r=new e(function(t){n.subscribe(t.next,t.error,t.complete)}),i=this.name+">$";return r.name=i,r}if(t[Symbol.iterator]){var r=new e(function(e){for(var n=e.next,r=e.error,i=e.complete,o=t[Symbol.iterator](),s=o.next();s.done===!1;s=o.next())s.value instanceof Error?r(s.value):n(s.value);i()}),i=(t[Symbol.toStringTag]||""+t||"#"+r.priority)+"$";return r.name=i,r}throw Error("Observable.from incorrect input")},e.prototype.map=function(t){var n=this,r=new e(function(e){var r=n.subscribe(function(n){try{var r=u.diagnose.isOn&&u.diagnose.measure("$> "+i),o=t(n);r&&r(),e.next(o)}catch(t){e.error(t)}},e.error,e.complete);return function(){return r.unsubscribe()}}),i=this.name+" |> "+(t.name||"#"+r.priority);return r.name=i,r},e.prototype.flatten=function(){var t=this,n=this.name+" |> $$>$",r=new e(function(e){t.subscribe(function(t){t&&t.subscribe(function(t){e.next(t)},function(t){return e.error(t)})},e.error,e.complete)});return r.name=n,r},e.prototype.scan=function(t){var n=this,r=new e(function(e){var r,i=0,o=n.subscribe(function(n){try{r=t(r,n,i++),e.next(r)}catch(t){e.error(t)}},e.error,e.complete);return function(){return o.unsubscribe()}}),i=this.name+" += "+(t||"#"+r.priority);return r.name=i,r},e.prototype.filter=function(t){var n=this,r=new e(function(e){var r=n.subscribe(function(n){try{t(n)&&e.next(n)}catch(t){e.error(t)}},e.error,e.complete);return function(){return r.unsubscribe()}}),i=this.name+" ? "+(t.name||"#"+r.priority);return r.name=i,r},e.prototype.merge=function(){for(var t=[],n=0;arguments.length>n;n++)t[n]=arguments[n];var r=0,i=new e,o={start:function(){},next:function(t){i.next(t)},error:function(t){i.error(t)},complete:function(){r++,r===t.length+1&&i.complete()}};return this.subscribe(o),t.forEach(function(t){return t.subscribe(o)}),i.name="( "+[this].concat(t).map(function(t){return t.name}).join(" + ")+" )",i},e.prototype.bufferCount=function(t,n){var r=this,i=void 0===n?t:n,o=[],s=new e(function(e){var n=r.subscribe(function(n){o.push(n),o.length===t&&(e.next(o.slice()),o=o.splice(i,t-i))},e.error,function(){o.length>t-i&&e.next(o.slice()),e.complete()});return function(){return n.unsubscribe()}});return s.name=this.name+" >|>"+t+","+i,s},e.prototype.buffer=function(t){var n=this;void 0===t&&(t=0);var r=[],i=new e(function(e){var i=n.subscribe(function(n){r=t>0?[n].concat(r).splice(0,t):[n].concat(r),s.dispatch(function(){0!==r.length&&e.next(r.splice(0).reverse())},o.DispatcherPriorities.BUFFER)},e.error,function(){r.length>0&&e.next(r.splice(0).reverse()),e.complete()});return function(){return i.unsubscribe()}});return i.name=this.name+" >|>",i},e}(i.BaseObservable);e.Observable=a,a.prototype[c]=function(){return this}},function(t,e,n){"use strict";var r,i=n(1),o=n(2),s=n(3),u=n(10);!function(t){t[t.Next=0]="Next",t[t.Error=1]="Error",t[t.Complete=2]="Complete"}(r=e.MessageTypes||(e.MessageTypes={}));var c=function(){},a=function(){function t(e){var n=this;this.closed=!1;var i=this;return this.observers=[],this.priority=t.lastObservablePriority++,e?(e.name&&void 0===this.name&&(this.name=e.name+"$"),void(this.cancelSubscriber=e({next:function(t){n.pushMessage([r.Next,"function"==typeof t?t:function(){return t},c])},error:function(t){n.pushMessage([r.Error,t,c])},complete:function(){n.pushMessage([r.Complete,,c])},get closed(){return i.observers.length>0}})||c)):void(this.cancelSubscriber=c)}return t.prototype.previous=function(){return this.lastValue},t.prototype.start=function(){},t.prototype.next=function(t){this.pushMessage([r.Next,"function"==typeof t?t:function(){return t},c])},t.prototype.error=function(t){this.pushMessage([r.Error,t,c])},t.prototype.complete=function(){this.pushMessage([r.Complete,,c])},t.prototype.subscribe=function(){for(var e=this,n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];if(this.closed)return new u.Subscription(null,function(){return!1});if("object"!=typeof n[0]||null===n[0]){var i=n[0],o=void 0===i?c:i,s=n[1],a=void 0===s?c:s,f=n[2],p=void 0===f?c:f;return this.subscribe({start:c,next:o,error:a,complete:p})}var l=n[0];this.observers.push(l);var h=new u.Subscription(function(){e.observers=e.observers.filter(function(t){return t!==l})},function(){return e.observers.indexOf(l)>-1});return l.start(h),t.dispatchDigestMessages(),h},t.prototype.pushMessage=function(e){this.closed||(t.awaitingMessages.push([this,e]),t.dispatchDigestMessages())},t.dispatchDigestMessages=function(){i.dispatch(t.digestAwaitingMessages,o.DispatcherPriorities.OBSERVABLE)},t.digestAwaitingMessages=function(){var e=t.popMessage(),n=e[0],r=e[1];n&&!n.closed&&(t.digestNodeMessage(n,r),t.dispatchDigestMessages())},t.popMessage=function(){if(0===t.awaitingMessages.length)return[null,null];for(var e=0;t.awaitingMessages.length>e;e++){var n=t.awaitingMessages[e],r=n[0],i=void 0===r?null:r,o=n[1];if(i.observers.length)return t.awaitingMessages.splice(e,1),[i,o]}return[null,null]},t.digestNodeMessage=function(t,e){var n=e[0],u=e[2];if(n===r.Next){var a=e,f=a[1],p=s.diagnose.isOn&&s.diagnose.measure("$> "+(t.name||"[anonymous]")+".next"+(f.name?"("+f.name+")":"")),l=f(t.lastValue);p&&p(),t.lastValue=l,t.observers.forEach(function(t){return t.next(l)})}else if(n===r.Error){var h=e,v=h[1];t.observers.forEach(function(t){return t.error(v)})}else n===r.Complete&&(t.cancelSubscriber(),t.cancelSubscriber=c,t.closed=!0,t.observers.splice(0).forEach(function(t){return t.complete()}));i.dispatch(u,o.DispatcherPriorities.OBSERVABLE)},t}();a.awaitingMessages=[],a.lastObservablePriority=0,e.BaseObservable=a},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=this&&this.__assign||Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},o=n(4),s=function(t){function e(e){return t.call(this,function(t){var n=[],r=[],o=[],s={},u=[],c=function(c){return Object.prototype.hasOwnProperty.call(e,c)?(n.push(c),void u.push(e[c].subscribe(function(e){if(o&&o.push([c,e]),r.indexOf(c)<0&&r.push(c),n.length===r.length){if(o){for(var u={},a=[],f=[],p=0;o.length>p;p++)if(a.indexOf(o[p][0])<0){var l=o[p],h=l[0],v=l[1];u[h]=v,a.push(h)}else f.push(o[p]);return t.next(s=u),f.forEach(function(e){var n=e[0],r=e[1];t.next(s=i({},s,(o={},o[n]=r,o)));var o}),void(o=null)}t.next(s=i({},s,(b={},b[c]=e,b)));var b}}))):"continue"};for(var a in e)c(a);return function(){u.forEach(function(t){return t()})}})||this}return r(e,t),e}(o.Observable);e.Combine=s},function(t,e){"use strict";var n=function(){function t(){this._isRunning=!1,this.subsequentCalls=0,this.tasks=[]}return Object.defineProperty(t.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),t.prototype.push=function(t,e){return this.tasks.push({priority:e,execute:t}),this},t.prototype.run=function(){var t=this;this._isRunning||(this._isRunning=!0,Promise.resolve().then(function(){return t.loop()}))},t.prototype.loop=function(){var t=this,e=this.findNextTask();return e?(this.subsequentCalls>1024&&this.tooManyCalls(),this.subsequentCalls++,void this.next(e.execute,function(){return t.loop()})):(this._isRunning=!1,void(this.subsequentCalls=0))},t.prototype.tooManyCalls=function(){"If you see this, that means your code made too many subsequent messages.";"This situation is considered harmful."},t.prototype.findNextTask=function(){for(var t=null,e=0;this.tasks.length>e;e++)(null===t||this.tasks[t].priority>this.tasks[e].priority)&&(t=e);return null===t?null:this.tasks.splice(t,1)[0]},t.prototype.next=function(t,e){try{t()}catch(t){console.error(t.stack||t.message||t)}e()},t}();e.Dispatcher=n},function(t,e,n){"use strict";function r(t,e,n){var r=n.value;n.value=function(){for(var t=this,e=[],n=0;arguments.length>n;n++)e[n]=arguments[n];return o.dispatchPromise(function(){r.apply(t,e)},i.DispatcherPriorities.DOMAIN)}}var i=n(2),o=n(1);e.action=r},function(t,e,n){"use strict";var r=this&&this.__extends||function(t,e){function n(){this.constructor=t}for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},i=n(4),o=n(2),s=n(1),u=n(3),c=function(t){function e(e){var n=this;return e?n=t.call(this,function(){e.subscribe(n)})||this:void(n=t.call(this)||this)}return r(e,t),e.tagged=function(t){for(var n=[],r=1;arguments.length>r;r++)n[r-1]=arguments[r];var i=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e.create.apply(void 0,r);return o.name=t.reduce(function(t,e,r){return t+(r>0?n[r-1]:"")+e}),o};return i},e.create=function(){for(var t=[],n=0;arguments.length>n;n++)t[n]=arguments[n];var r,i,c;"object"==typeof t[0]&&null!==t[0]&&"function"==typeof t[0].subscribe&&(r=t.shift()),i=t.shift(),c=t.shift();var a=new e(r);if(i){var f=function(t){var e=t;return Object.prototype.hasOwnProperty.call(i,t)?void(a[t]=function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return s.dispatchPromise(function(){var r=u.diagnose.measure("<$ "+(a.name?a.name+".":"")+e);i[t].apply(a,n),r&&r()},o.DispatcherPriorities.DOMAIN)}):"continue"};for(var p in i)f(p)}if(c)for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(a[l]=c[l]);return a},e}(i.Observable);e.Domain=c},function(t,e){"use strict";var n=function(){function t(t,e){this.customUnsubscribe=t,this.isSubscriptionActive=e}return Object.defineProperty(t.prototype,"closed",{get:function(){return!this.isSubscriptionActive()},enumerable:!0,configurable:!0}),t.prototype.unsubscribe=function(){var t=this.customUnsubscribe;t&&(this.customUnsubscribe=null,t&&t())},t}();e.Subscription=n}])});
//# sourceMappingURL=immview.js.map

@@ -1,2 +0,2 @@

import { Dispatcher } from './DispatcherInstance';
import { dispatcher } from './DispatcherInstance';
import { Observable } from './Observable';

@@ -6,3 +6,4 @@ import { Combine } from './Combine';

import { action } from './Domain.action';
import { diagnose } from './Diagnose';
declare const dispatchExt: (job: () => any) => void;
export { Observable, Combine, Combine as Merge, Domain, Dispatcher, dispatchExt as dispatch, action };
export { Observable, Combine, Combine as Merge, Domain, dispatcher, dispatchExt as dispatch, action, diagnose };

@@ -10,4 +10,4 @@ import { BaseObservable } from './BaseObservable';

merge(...others: Observable<T>[]): Observable<T>;
bufferCount(bufferSize: number, customBufferCount?: number): Observable<T[]>;
bufferCount(bufferWindow: number, customBufferStep?: number): Observable<T[]>;
buffer(maxLastValues?: number): Observable<T[]>;
}
{
"name": "immview",
"version": "2.0.9",
"version": "2.0.10",
"description": "",

@@ -5,0 +5,0 @@ "main": "./dist/immview.js",

@@ -12,4 +12,5 @@ {

],
"experimentalDecorators": true
"experimentalDecorators": true,
"alwaysStrict": true
}
}

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