deep-state-observer
Advanced tools
Comparing version 5.5.5 to 5.5.6
@@ -29,2 +29,3 @@ export interface PathInfo { | ||
maxQueueRuns?: number; | ||
defaultBulkValue?: boolean; | ||
log?: (message: string, info: any) => void; | ||
@@ -188,2 +189,3 @@ debug?: boolean; | ||
constructor(data?: object, options?: Options); | ||
private getDefaultListenerOptions; | ||
private cacheGet; | ||
@@ -190,0 +192,0 @@ private cacheSet; |
35
index.ts
@@ -36,2 +36,3 @@ import WildcardObject from "./wildcard-object-scan"; | ||
maxQueueRuns?: number; | ||
defaultBulkValue?: boolean; | ||
log?: (message: string, info: any) => void; | ||
@@ -234,2 +235,3 @@ debug?: boolean; | ||
queue: false, | ||
defaultBulkValue: true, | ||
useCache: false, | ||
@@ -245,12 +247,2 @@ useSplitCache: false, | ||
const defaultListenerOptions: ListenerOptions = { | ||
bulk: false, | ||
bulkValue: true, | ||
debug: false, | ||
source: "", | ||
data: undefined, | ||
queue: false, | ||
group: false, | ||
}; | ||
/** | ||
@@ -326,2 +318,14 @@ * Is object - helper function to determine if specified variable is an object | ||
private getDefaultListenerOptions(): ListenerOptions { | ||
return { | ||
bulk: false, | ||
bulkValue: this.options.defaultBulkValue, | ||
debug: false, | ||
source: "", | ||
data: undefined, | ||
queue: false, | ||
group: false, | ||
}; | ||
} | ||
private cacheGet(pathChunks: string[], data: any = this.data, create = false) { | ||
@@ -579,3 +583,3 @@ const path = pathChunks.join(this.options.delimiter); | ||
fn: ListenerFunction | WaitingListenerFunction, | ||
options: ListenerOptions = defaultListenerOptions | ||
options: ListenerOptions = this.getDefaultListenerOptions() | ||
) { | ||
@@ -626,6 +630,9 @@ if (this.destroyed) return () => {}; | ||
private getCleanListener(fn: ListenerFunction, options: ListenerOptions = defaultListenerOptions): Listener { | ||
private getCleanListener( | ||
fn: ListenerFunction, | ||
options: ListenerOptions = this.getDefaultListenerOptions() | ||
): Listener { | ||
return { | ||
fn, | ||
options: { ...defaultListenerOptions, ...options }, | ||
options: { ...this.getDefaultListenerOptions(), ...options }, | ||
groupId: null, | ||
@@ -696,3 +703,3 @@ }; | ||
fn: ListenerFunction, | ||
options: ListenerOptions = defaultListenerOptions, | ||
options: ListenerOptions = this.getDefaultListenerOptions(), | ||
subscribeAllOptions: SubscribeAllOptions = { | ||
@@ -699,0 +706,0 @@ all: [listenerPath as string], |
{ | ||
"name": "deep-state-observer", | ||
"version": "5.5.5", | ||
"version": "5.5.6", | ||
"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
560698
14347