{"id":"../node_modules/@pushrocks/lik/dist/lik.interestmap.interest.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/ts/lik.interestmap.interest.ts","includedInParent":true,"mtime":499162500000},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/package.json","includedInParent":true,"mtime":1545395695572},{"name":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/package.json","includedInParent":true,"mtime":1545395355371},{"name":"./lik.plugins","loc":{"line":3,"column":24},"parent":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.interestmap.interest.js","resolved":"/Users/philkunz/gitlab/pushrocks_meta/webdetector/node_modules/@pushrocks/lik/dist/lik.plugins.js"}],"generated":{"js":"\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst plugins = require(\"./lik.plugins\");\nclass Interest {\n /**\n *\n */\n constructor(interestMapArg, interestArg, comparisonFuncArg) {\n this.destructionTimer = new plugins.smarttime.Timer(10000);\n this.isFullfilled = false;\n /**\n * a generic store to store objects in that are needed for fullfillment;\n */\n this.fullfillmentStore = [];\n this.interestDeferred = new plugins.smartpromise.Deferred();\n this.interestFullfilled = this.interestDeferred.promise;\n this.originalInterest = interestArg;\n this.comparisonFunc = comparisonFuncArg;\n this.interestMapRef = interestMapArg;\n this.destructionTimer.completed.then(() => {\n this.destroy();\n });\n }\n /**\n * quick access to a string that makes the interest comparable for checking for similar interests\n */\n get comparisonString() {\n return this.comparisonFunc(this.originalInterest);\n }\n /**\n * fullfill the interest\n */\n fullfillInterest(objectArg) {\n this.isFullfilled = true;\n this.fullfillmentStore = [];\n this.interestDeferred.resolve(objectArg);\n }\n // ===============================\n // LIFECYCLE MANAGEMENT\n // ===============================\n /**\n * self destructs the interest\n */\n destroy() {\n this.interestMapRef.removeInterest(this);\n }\n /**\n * notifies the interest that the interest in it has been lost\n */\n markLost() {\n this.destructionTimer.start();\n }\n /**\n * notifies the interest that the interest in it has been restored\n */\n renew() {\n this.destructionTimer.reset();\n }\n}\nexports.Interest = Interest;\n","map":{"version":3,"file":"lik.interestmap.interest.js","sourceRoot":"","sources":["../ts/lik.interestmap.interest.ts"],"names":[],"mappings":";;AAAA,yCAAyC;AAIzC,MAAa,QAAQ;IAiCnB;;OAEG;IACH,YACE,cAAiE,EACjE,WAAyB,EACzB,iBAAwD;QAnCnD,qBAAgB,GAAG,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACtD,iBAAY,GAAG,KAAK,CAAC;QAE5B;;WAEG;QACI,sBAAiB,GAAU,EAAE,CAAC;QAS7B,qBAAgB,GAEpB,IAAI,OAAO,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;QACjC,uBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;QAmBxD,IAAI,CAAC,gBAAgB,GAAG,WAAW,CAAC;QACpC,IAAI,CAAC,cAAc,GAAG,iBAAiB,CAAC;QACxC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;QACrC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,EAAE;YACxC,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAnCD;;OAEG;IACH,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACpD,CAAC;IAOD;;OAEG;IACI,gBAAgB,CAAC,SAAiC;QACvD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QACzB,IAAI,CAAC,iBAAiB,GAAG,EAAE,CAAC;QAC5B,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAkBD,kCAAkC;IAClC,uBAAuB;IACvB,kCAAkC;IAElC;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,QAAQ;QACb,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,KAAK;QACV,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;IAChC,CAAC;CACF;AAzED,4BAyEC","sourcesContent":["import * as plugins from './lik.plugins';\n\nimport { InterestMap, IInterestComparisonFunc } from './lik.interestmap';\n\nexport class Interest {\n private interestMapRef: InterestMap;\n public originalInterest: DTInterestId;\n public comparisonFunc: IInterestComparisonFunc;\n public destructionTimer = new plugins.smarttime.Timer(10000);\n public isFullfilled = false;\n\n /**\n * a generic store to store objects in that are needed for fullfillment;\n */\n public fullfillmentStore: any[] = [];\n\n /**\n * quick access to a string that makes the interest comparable for checking for similar interests\n */\n public get comparisonString() {\n return this.comparisonFunc(this.originalInterest);\n }\n\n private interestDeferred: plugins.smartpromise.Deferred<\n DTInterestFullfillment\n > = new plugins.smartpromise.Deferred();\n public interestFullfilled = this.interestDeferred.promise;\n\n /**\n * fullfill the interest\n */\n public fullfillInterest(objectArg: DTInterestFullfillment) {\n this.isFullfilled = true;\n this.fullfillmentStore = [];\n this.interestDeferred.resolve(objectArg);\n }\n\n /**\n *\n */\n constructor(\n interestMapArg: InterestMap,\n interestArg: DTInterestId,\n comparisonFuncArg: IInterestComparisonFunc\n ) {\n this.originalInterest = interestArg;\n this.comparisonFunc = comparisonFuncArg;\n this.interestMapRef = interestMapArg;\n this.destructionTimer.completed.then(() => {\n this.destroy();\n });\n }\n\n // ===============================\n // LIFECYCLE MANAGEMENT\n // ===============================\n\n /**\n * self destructs the interest\n */\n public destroy() {\n this.interestMapRef.removeInterest(this);\n }\n\n /**\n * notifies the interest that the interest in it has been lost\n */\n public markLost() {\n this.destructionTimer.start();\n }\n\n /**\n * notifies the interest that the interest in it has been restored\n */\n public renew() {\n this.destructionTimer.reset();\n }\n}\n"]}},"hash":"0bbdfe1cc00cb7049871cada74542941","cacheData":{"env":{}}}