@schoolbelle/common
Version:
Demo library to showcase Angular packaging format
2 lines • 2.38 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("rxjs"),require("lodash")):"function"==typeof define&&define.amd?define("@schoolbelle/common/services/infinite-scroll-list",["exports","@angular/core","rxjs","lodash"],t):t((e.schoolbelle=e.schoolbelle||{},e.schoolbelle.common=e.schoolbelle.common||{},e.schoolbelle.common.services=e.schoolbelle.common.services||{},e.schoolbelle.common.services["infinite-scroll-list"]={}),e.ng.core,e.rxjs,null)}(this,function(e,n,o,i){"use strict";var t=function(){this.debounce=400,this.max_size_per_query=10},r=new n.InjectionToken("InfiniteScrollListConfigInterface"),s=function(){function t(){}return t.forRoot=function(e){return void 0===e&&(e={}),{ngModule:t,providers:[]}},t.decorators=[{type:n.NgModule,args:[{}]}],t}(),l=function(){function e(){this.disabled=!1,this.token="",this._list=[],this.listChangeEvent=new o.BehaviorSubject(this._list)}return Object.defineProperty(e.prototype,"list",{get:function(){return this.listChangeEvent.asObservable()},enumerable:!0,configurable:!0}),e.prototype.push=function(e,t){var n=this;if(void 0===t&&(t=""),this.token=t,e instanceof Promise)return e.then(function(e){t===n.token&&(Array.isArray(e)?e.forEach(function(e){return n._list.push(e)}):n._list.push(e))}),e;if(e instanceof o.Observable){var i=e.subscribe(function(e){t===n.token&&(Array.isArray(e)?e.forEach(function(e){return n._list.push(e)}):n._list.push(e),i.unsubscribe())});return e.toPromise()}return Array.isArray(e)?e.forEach(function(e){return n._list.push(e)}):this._list.push(e),Promise.resolve(e)},e.prototype.empty=function(){this._list.splice(0,this._list.length)},e.prototype.getMaxId=function(e){var t=i.maxBy(this._list,e);return t?t[e]:undefined},e.prototype.getMinId=function(e){var t=i.minBy(this._list,e);return t?t[e]:undefined},e.prototype.find=function(e){return i.find(this.list,e)},Object.defineProperty(e.prototype,"size",{get:function(){return this._list.length},enumerable:!0,configurable:!0}),e.decorators=[{type:n.Injectable}],e.ctorParameters=function(){return[]},e}();e.InfiniteScrollListConfigDefault=t,e.INFINITE_SCROLL_LIST_CONFIG_TOKEN=r,e.InfiniteScrollListModule=s,e.InfiniteScrollListService=l,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=schoolbelle-common-services-infinite-scroll-list.umd.min.js.map