Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): Correct API docs for memoize() which only handles one arg #459

Merged
merged 2 commits into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lua/pl/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,8 @@ end
-- This is useful if you have a function which is relatively expensive,
-- but you don't know in advance what values will be required, so
-- building a table upfront is wasteful/impossible.
-- @param func a function of at least one argument
-- @return a function with at least one argument, which is used as the key.
-- @param func a function that takes exactly one argument (which later serves as the cache key) and returns a single value
-- @return a function taking one argument and returning a single value either from the cache or by running the original input function
function utils.memoize(func)
local cache = {}
return function(k)
Expand Down
Loading