deep-state-observer
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -25,2 +25,3 @@ export interface PathInfo { | ||
useCache?: boolean; | ||
useSplitCache?: boolean; | ||
maxSimultaneousJobs?: number; | ||
@@ -180,2 +181,3 @@ maxQueueRuns?: number; | ||
private cache; | ||
private splitCache; | ||
constructor(data?: object, options?: Options); | ||
@@ -182,0 +184,0 @@ private cacheGet; |
15
index.ts
@@ -35,2 +35,3 @@ import WildcardObject from './wildcard-object-scan'; | ||
useCache?: boolean; | ||
useSplitCache?: boolean; | ||
maxSimultaneousJobs?: number; | ||
@@ -242,2 +243,3 @@ maxQueueRuns?: number; | ||
useCache: false, | ||
useSplitCache: false, | ||
maxSimultaneousJobs: 1000, | ||
@@ -302,2 +304,3 @@ maxQueueRuns: 1000, | ||
private cache: Map<string, any> = new Map(); | ||
private splitCache: Map<string, string[]> = new Map(); | ||
@@ -481,3 +484,13 @@ constructor(data: object = {}, options: Options = {}) { | ||
private split(path: string) { | ||
return path === '' ? [] : path.split(this.options.delimiter); | ||
if (path === '') return []; | ||
if (!this.options.useSplitCache) { | ||
return path.split(this.options.delimiter); | ||
} | ||
const fromCache = this.splitCache.get(path); | ||
if (fromCache) { | ||
return fromCache.slice(); | ||
} | ||
const value = path.split(this.options.delimiter); | ||
this.splitCache.set(path, value.slice()); | ||
return value; | ||
} | ||
@@ -484,0 +497,0 @@ |
{ | ||
"name": "deep-state-observer", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Deep state observer is an state management library that will fire listeners only when specified object node (which also can be a wildcard) was changed.", | ||
@@ -5,0 +5,0 @@ "main": "index.cjs.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
535917
13930