deep-state-observer
Advanced tools
Comparing version 4.0.4 to 4.0.5
@@ -138,3 +138,3 @@ export interface PathInfo { | ||
path: string; | ||
value: unknown; | ||
value: any; | ||
params: Params; | ||
@@ -149,3 +149,3 @@ } | ||
declare type PossiblePath<T> = PathImpl<T, keyof T> | keyof T | string; | ||
declare type PathValue<T, P extends PossiblePath<T>> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? Rest extends PossiblePath<T[K]> ? PathValue<T[K], Rest> : any & Bulk[] : any & Bulk[] : P extends keyof T ? T[P] & Bulk[] : any & Bulk[]; | ||
declare type PathValue<T, P extends PossiblePath<T>> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? Rest extends PossiblePath<T[K]> ? PathValue<T[K], Rest> : any : any : P extends keyof T ? T[P] : any; | ||
export interface UnknownObject { | ||
@@ -233,3 +233,3 @@ [key: string]: unknown; | ||
getCollectedStack(): UpdateStack[]; | ||
get<P extends PossiblePath<T>>(userPath: P | string): PathValue<T, P>; | ||
get<P extends PossiblePath<T>>(userPath: P): PathValue<T, P>; | ||
private lastExecs; | ||
@@ -239,3 +239,3 @@ last(callback: () => void): void; | ||
isMutedListener(listenerFunc: ListenerFunction<PathValue<T, PossiblePath<T>>>): boolean; | ||
mute(pathOrListenerFunction: string | ListenerFunction<PathValue<T, PossiblePath<T>>>): Set<ListenerFunction<(string extends keyof T ? T[keyof T & string] & Bulk[] : any) | PathValue<T, keyof T> | PathValue<T, PathImpl<T, keyof T>>>>; | ||
mute(pathOrListenerFunction: string | ListenerFunction<PathValue<T, PossiblePath<T>>>): Set<ListenerFunction<(string extends keyof T ? T[keyof T & string] : any) | PathValue<T, keyof T> | PathValue<T, PathImpl<T, keyof T>>>>; | ||
unmute(pathOrListenerFunction: string | ListenerFunction<PathValue<T, PossiblePath<T>>>): boolean; | ||
@@ -242,0 +242,0 @@ private debugSubscribe; |
12
index.ts
@@ -169,3 +169,3 @@ import WildcardObject from "./wildcard-object-scan"; | ||
path: string; | ||
value: unknown; | ||
value: any; | ||
params: Params; | ||
@@ -202,7 +202,7 @@ } | ||
? PathValue<T[K], Rest> | ||
: any & Bulk[] | ||
: any & Bulk[] | ||
: any | ||
: any | ||
: P extends keyof T | ||
? T[P] & Bulk[] | ||
: any & Bulk[]; | ||
? T[P] | ||
: any; | ||
@@ -1425,3 +1425,3 @@ function log(message: string, info: any) { | ||
public get<P extends PossiblePath<T>>(userPath: P | string): PathValue<T, P> { | ||
public get<P extends PossiblePath<T>>(userPath: P): PathValue<T, P> { | ||
if (this.destroyed) return; | ||
@@ -1428,0 +1428,0 @@ if (typeof userPath === "undefined" || userPath === "") { |
{ | ||
"name": "deep-state-observer", | ||
"version": "4.0.4", | ||
"version": "4.0.5", | ||
"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", |
@@ -1581,3 +1581,3 @@ /*! ***************************************************************************** | ||
const state = new DeepState(someState); | ||
state.subscribe("y.c", (v) => { }, { bulk: true }); | ||
state.subscribe("y.c.d", (v) => { }, { bulk: true }); | ||
state.$$$.y.c.d = 33; | ||
@@ -1584,0 +1584,0 @@ if (state.get("y.c.d") !== 33) { |
@@ -39,3 +39,3 @@ import * as path from "path"; | ||
state.subscribe("y.c", (v) => {}, { bulk: true }); | ||
state.subscribe("y.c.d", (v) => {}, { bulk: true }); | ||
@@ -42,0 +42,0 @@ state.$$$.y.c.d = 33; |
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
525428