Skip to content

Commit

Permalink
Added setMulti, made trim return this
Browse files Browse the repository at this point in the history
  • Loading branch information
ktaeyln committed Mar 24, 2018
1 parent f053261 commit 517382b
Show file tree
Hide file tree
Showing 5 changed files with 143 additions and 16 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,16 @@ export = class LRUWeakCache<V extends object> extends Map<string, V> {
* @param callback The callback to call when finished
*/
generateMulti(keys: string[], generator: CacheMultiGenerator<V>, callback: (err: Error, ret?: {[key: string]: V}) => void): Cancel<{[index:string]:V}>;
/**
* Efficiently set multiple values while maintaining the capacity and other settings
*/
setMulti(data: {[index: string]: V}): this;
/**
* Trim least-recently-used items from this map.
*
* @param by The amount to trim by
*/
trim(by: number): void;
trim(by: number): this;
}

interface VCancel {
Expand Down
73 changes: 67 additions & 6 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 517382b

Please sign in to comment.