From 069b26cdd7d62e6ac16a0ad3baa1c9abcca420bc Mon Sep 17 00:00:00 2001 From: Ray Epps Date: Thu, 7 Mar 2024 17:29:46 -0700 Subject: [PATCH] add return type generic to memo func (#381) --- package.json | 2 +- src/curry.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a6aa123b..0f7a54c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "radash", - "version": "12.0.0", + "version": "12.1.0", "description": "Functional utility library - modern, simple, typed, powerful", "main": "dist/cjs/index.cjs", "module": "dist/esm/index.mjs", diff --git a/src/curry.ts b/src/curry.ts index 1d359441..2725ea53 100644 --- a/src/curry.ts +++ b/src/curry.ts @@ -466,8 +466,8 @@ const memoize = ( * is given previously computed values will be checked * for expiration before being returned. */ -export const memo = ( - func: (...args: TArgs) => any, +export const memo = ( + func: (...args: TArgs) => TResult, options: { key?: (...args: TArgs) => string ttl?: number @@ -475,7 +475,7 @@ export const memo = ( ) => { return memoize({}, func, options.key ?? null, options.ttl ?? null) as ( ...args: TArgs - ) => any + ) => TResult } export type DebounceFunction = {