deep-state-observer
Advanced tools
Comparing version 5.1.0 to 5.2.0
@@ -182,2 +182,9 @@ export interface PathInfo { | ||
private cacheSet; | ||
/** | ||
* Silently update data | ||
* @param path string | ||
* @param value any | ||
* @returns | ||
*/ | ||
silentSet(path: string, value: any): any; | ||
loadWasmMatcher(pathToWasmFile: string): Promise<void>; | ||
@@ -184,0 +191,0 @@ private same; |
10
index.ts
@@ -365,2 +365,12 @@ import WildcardObject from './wildcard-object-scan'; | ||
/** | ||
* Silently update data | ||
* @param path string | ||
* @param value any | ||
* @returns | ||
*/ | ||
public silentSet(path: string, value: any) { | ||
return this.pathSet(this.split(path), value, this.data); | ||
} | ||
public async loadWasmMatcher(pathToWasmFile: string) { | ||
@@ -367,0 +377,0 @@ await init(pathToWasmFile); |
{ | ||
"name": "deep-state-observer", | ||
"version": "5.1.0", | ||
"version": "5.2.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", |
@@ -882,2 +882,11 @@ const State = require('../index.cjs.js'); | ||
it('should change data without update', () => { | ||
const state = new State({ x: { y: { z: 2 } }, xx: 22 }); | ||
expect(state.get('x.y.z')).toEqual(2); | ||
const y = state.get('x.y'); | ||
y.z = 22; | ||
expect(state.get('x.y.z')).toEqual(22); | ||
expect(state.data.x.y.z).toEqual(22); | ||
}); | ||
it('should ignore ignored changes', () => { | ||
@@ -884,0 +893,0 @@ const state = new State({ one: { two: { three: { four: { five: 0 } } } } }); |
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
533743
13863