fenextjs-hook
Advanced tools
Comparing version 10.6.6 to 10.6.7
@@ -60,3 +60,7 @@ /// <reference types="react" /> | ||
autoOnValidate?: boolean; | ||
env_log?: { | ||
[id in useDataOptionsEnvLog]?: boolean; | ||
}; | ||
} | ||
export type useDataOptionsEnvLog = "data" | "dataMemo" | "isValidData" | "isValidDataMemo" | "dataError" | "dataErrorMemo" | "loaderSubmit" | "loaderSubmitMemo" | "keyData" | "isChange"; | ||
export interface onChangeDataOptionsProps<T> { | ||
@@ -63,0 +67,0 @@ onCallback?: (data: T) => void; |
@@ -6,2 +6,3 @@ "use strict"; | ||
const useDataValidator_1 = require("./useDataValidator"); | ||
const fenextjs_functions_1 = require("fenextjs-functions"); | ||
/** | ||
@@ -255,2 +256,64 @@ * A custom hook to manage data state and changes. | ||
const validatorData = (0, react_1.useMemo)(() => options?.validator?.getObjectValidator?.(), [options?.validator]); | ||
if (options?.env_log) { | ||
if (options?.env_log?.data == true) { | ||
(0, fenextjs_functions_1.env_log)(data, { | ||
name: "useData - data", | ||
color: "#22cc8c", | ||
}); | ||
} | ||
if (options?.env_log?.dataMemo == true) { | ||
(0, fenextjs_functions_1.env_log)(dataMemo, { | ||
name: "useData - dataMemo", | ||
color: "#22cc8c", | ||
}); | ||
} | ||
if (options?.env_log?.isValidData == true) { | ||
(0, fenextjs_functions_1.env_log)(isValidData, { | ||
name: "useData - isValidData", | ||
color: "#f96161", | ||
}); | ||
} | ||
if (options?.env_log?.isValidDataMemo == true) { | ||
(0, fenextjs_functions_1.env_log)(isValidDataMemo, { | ||
name: "useData - isValidDataMemo", | ||
color: "#f96161", | ||
}); | ||
} | ||
if (options?.env_log?.dataError == true) { | ||
(0, fenextjs_functions_1.env_log)(dataError, { | ||
name: "useData - dataError", | ||
color: "#e84275", | ||
}); | ||
} | ||
if (options?.env_log?.dataErrorMemo == true) { | ||
(0, fenextjs_functions_1.env_log)(dataErrorMemo, { | ||
name: "useData - dataErrorMemo", | ||
color: "#e84275", | ||
}); | ||
} | ||
if (options?.env_log?.loaderSubmit == true) { | ||
(0, fenextjs_functions_1.env_log)(loaderSubmit, { | ||
name: "useData - loaderSubmit", | ||
color: "#f96161", | ||
}); | ||
} | ||
if (options?.env_log?.loaderSubmitMemo == true) { | ||
(0, fenextjs_functions_1.env_log)(loaderSubmitMemo, { | ||
name: "useData - loaderSubmitMemo", | ||
color: "#f96161", | ||
}); | ||
} | ||
if (options?.env_log?.keyData == true) { | ||
(0, fenextjs_functions_1.env_log)(keyData, { | ||
name: "useData - keyData", | ||
color: "#8d63e9", | ||
}); | ||
} | ||
if (options?.env_log?.isChange == true) { | ||
(0, fenextjs_functions_1.env_log)(isChange, { | ||
name: "useData - isChange", | ||
color: "#8d63e9", | ||
}); | ||
} | ||
} | ||
return { | ||
@@ -257,0 +320,0 @@ data, |
{ | ||
"name": "fenextjs-hook", | ||
"version": "10.6.6", | ||
"version": "10.6.7", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
Sorry, the diff of this file is not supported yet
127407
2251