@arque/core
Advanced tools
Comparing version 0.4.3 to 0.5.0
@@ -20,2 +20,13 @@ /// <reference types="node" /> | ||
private readonly opts; | ||
/** | ||
* @param store | ||
* @param stream | ||
* @param commandHandlers | ||
* @param eventHandlers | ||
* @param opts.defaultState - The default state of the aggregate. default: `null` | ||
* @param opts.cacheMax - The maximum number of aggregates to cache. default: `2046` | ||
* @param opts.cacheTTL - The time-to-live of the cache in milliseconds. default: `172800000` (48 hours) | ||
* @param opts.shouldTakeSnapshot - A function that determines if a snapshot should be taken. default: `undefined` | ||
* @param opts.snapshotInterval - The interval at which snapshots should be taken. default: `20` | ||
*/ | ||
constructor(store: StoreAdapter, stream: StreamAdapter, commandHandlers: ExtractCommandHandler<T>[], eventHandlers: ExtractEventHandler<T>[], opts?: Partial<Options<T>>); | ||
@@ -22,0 +33,0 @@ clear(): Promise<void>; |
@@ -8,2 +8,13 @@ "use strict"; | ||
class AggregateFactory { | ||
/** | ||
* @param store | ||
* @param stream | ||
* @param commandHandlers | ||
* @param eventHandlers | ||
* @param opts.defaultState - The default state of the aggregate. default: `null` | ||
* @param opts.cacheMax - The maximum number of aggregates to cache. default: `2046` | ||
* @param opts.cacheTTL - The time-to-live of the cache in milliseconds. default: `172800000` (48 hours) | ||
* @param opts.shouldTakeSnapshot - A function that determines if a snapshot should be taken. default: `undefined` | ||
* @param opts.snapshotInterval - The interval at which snapshots should be taken. default: `20` | ||
*/ | ||
constructor(store, stream, commandHandlers, eventHandlers, opts) { | ||
@@ -15,3 +26,3 @@ var _a, _b, _c, _d; | ||
this.eventHandlers = eventHandlers; | ||
this.opts = Object.assign(Object.assign({}, opts), { defaultState: (_a = opts === null || opts === void 0 ? void 0 : opts.defaultState) !== null && _a !== void 0 ? _a : null, cacheMax: (_b = opts === null || opts === void 0 ? void 0 : opts.cacheMax) !== null && _b !== void 0 ? _b : 256, cacheTTL: (_c = opts === null || opts === void 0 ? void 0 : opts.cacheTTL) !== null && _c !== void 0 ? _c : 86400000, shouldTakeSnapshot: opts === null || opts === void 0 ? void 0 : opts.shouldTakeSnapshot, snapshotInterval: (_d = opts === null || opts === void 0 ? void 0 : opts.snapshotInterval) !== null && _d !== void 0 ? _d : 100 }); | ||
this.opts = Object.assign(Object.assign({}, opts), { defaultState: (_a = opts === null || opts === void 0 ? void 0 : opts.defaultState) !== null && _a !== void 0 ? _a : null, cacheMax: (_b = opts === null || opts === void 0 ? void 0 : opts.cacheMax) !== null && _b !== void 0 ? _b : 2046, cacheTTL: (_c = opts === null || opts === void 0 ? void 0 : opts.cacheTTL) !== null && _c !== void 0 ? _c : 172800000, shouldTakeSnapshot: opts === null || opts === void 0 ? void 0 : opts.shouldTakeSnapshot, snapshotInterval: (_d = opts === null || opts === void 0 ? void 0 : opts.snapshotInterval) !== null && _d !== void 0 ? _d : 20 }); | ||
this.cache = new lru_cache_1.LRUCache({ | ||
@@ -18,0 +29,0 @@ max: this.opts.cacheMax, |
{ | ||
"name": "@arque/core", | ||
"version": "0.4.3", | ||
"version": "0.5.0", | ||
"description": "`arque` core library", | ||
@@ -34,3 +34,3 @@ "author": "ScaleForge", | ||
}, | ||
"gitHead": "6f13c42fc7c0d38cf3b434e1535392d68a499c03" | ||
"gitHead": "a3c5c6907d96a89e191077a3c14598f2aaca656d" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45576
758