Comparing version 1.7.1 to 1.7.2
{ | ||
"name": "idmp", | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"keywords": [ | ||
@@ -5,0 +5,0 @@ "cache response", |
@@ -27,3 +27,3 @@ # idmp | ||
// Only this line changed | ||
// Only one line need to change | ||
export const getInfoIdmp = () => idmp('/api/your-info', getInfo) | ||
@@ -48,11 +48,11 @@ | ||
// 处理有入参的场景 | ||
// Handle params | ||
export const getInfoByIdIdmp = (id: string) => | ||
idmp(`/api/your-info?${id}`, () => getInfoById(id)) | ||
// 或者更通用的类型体操写法,用于复杂的入参,idmp 会自动推导返回值类型,与原函数保持一致 | ||
// Or a more generic type juggling, for complex params, idmp will infer the return type automatically, keep it consistent with the original function | ||
export const getInfoByIdIdmp = (...args: Parameters<typeof getInfoById>) => | ||
idmp(`/api/your-info?${JSON.stringify(args)}`, () => getInfoById(...args)) | ||
// 增加更多配置项 | ||
// More options | ||
export const getInfoByIdIdmp = (id: string) => | ||
@@ -59,0 +59,0 @@ idmp(`/api/your-info?${id}`, () => getInfoById(id), { |
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
61476
69