@neovici/cosmoz-utils 5.15.0 → 5.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- declare const notifyProperty: <K extends string, T extends HTMLElement & { [key in K]?: unknown; }>(host: T, name: K, value: T[K]) => void, useNotifyProperty: <T extends HTMLElement, K extends Extract<keyof T, string>, V extends T[K]>(name: K, value: V) => void;
1
+ declare const notifyProperty: <K extends string, T extends HTMLElement & { [key in K]?: unknown; }>(host: T, name: K, value: T[K]) => void, useNotifyProperty: <T extends HTMLElement, K extends Extract<keyof T, string>, V extends T[K]>(name: K, value: V, deps?: unknown[]) => void;
2
2
  export { notifyProperty, useNotifyProperty };
@@ -10,10 +10,10 @@ notifyProperty = (host, name, value) => {
10
10
  host.dispatchEvent(new CustomEvent(name.replace(UPPER, '-$1').toLowerCase() + '-changed', {
11
11
  detail: { value },
12
12
  }));
13
- }, useNotifyProperty = (name, value) => {
13
+ }, useNotifyProperty = (name, value, deps = [value]) => {
14
14
  const host = useHost();
15
15
  useEffect(() => {
16
16
  notifyProperty(host, name, value);
17
- }, [value]);
17
+ }, deps);
18
18
  };
19
19
  export { notifyProperty, useNotifyProperty };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neovici/cosmoz-utils",
3
- "version": "5.15.0",
3
+ "version": "5.16.0",
4
4
  "description": "Date, money and template management functions commonly needed in Cosmoz views.",
5
5
  "keywords": [
6
6
  "polymer",