Skip to content

Commit

Permalink
Release 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
angelnikolov committed Apr 23, 2021
1 parent 0361e9e commit 89273d9
Show file tree
Hide file tree
Showing 36 changed files with 207 additions and 119 deletions.
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,20 @@ Also, you can specify the caching strategy on a decorator basis, so if you want
It's also really easy to implement your own caching strategy, by extending the IStorageStrategy abstract class, which has this shape:
```ts
export abstract class IStorageStrategy {
abstract getAll(cacheKey: string): Array<ICachePair<any>>;
abstract add(entity: ICachePair<any>, cacheKey: string): void;
abstract getAll(cacheKey: string, ctx?: any): Array<ICachePair<any>>;
abstract add(entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
/**
* @deprecated Use update instead.
*/
abstract updateAtIndex(index: number, entity: ICachePair<any>, cacheKey: string): void;
abstract update?(index: number, entity: ICachePair<any>, cacheKey: string): void;
abstract updateAtIndex(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
abstract update?(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
/**
* @deprecated Use remove instead.
*/
abstract removeAtIndex(index: number, cacheKey: string): void;
abstract remove?(index: number, entity: ICachePair<any>, cacheKey: string): void;
abstract removeAll(cacheKey: string): void;
abstract removeAtIndex(index: number, cacheKey: string, ctx?: any): void;
abstract remove?(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
abstract removeAll(cacheKey: string, ctx?: any): void;
abstract addMany(entities: ICachePair<any>[], cacheKey: string, ctx?: any): void;
}
```

Expand Down
16 changes: 9 additions & 7 deletions dist/cjs/cacheable.decorator.js

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

2 changes: 1 addition & 1 deletion dist/cjs/cacheable.decorator.js.map

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

16 changes: 8 additions & 8 deletions dist/cjs/common/IAsyncStorageStrategy.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ICachePair } from '.';
export declare abstract class IAsyncStorageStrategy {
abstract getAll(cacheKey: string): Array<ICachePair<any>> | Promise<Array<ICachePair<any>>>;
abstract add(entity: ICachePair<any>, cacheKey: string): void | Promise<void>;
abstract getAll(cacheKey: string, ctx?: any): Array<ICachePair<any>> | Promise<Array<ICachePair<any>>>;
abstract add(entity: ICachePair<any>, cacheKey: string, ctx?: any): void | Promise<void>;
/**
* @deprecated Use update instead.
*/
abstract updateAtIndex(index: number, entity: ICachePair<any>, cacheKey: string): void | Promise<void>;
abstract update?(index: number, entity: ICachePair<any>, cacheKey: string): Promise<void>;
abstract updateAtIndex(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void | Promise<void>;
abstract update?(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): Promise<void>;
/**
* @deprecated Use remove instead.
*/
abstract removeAtIndex(index: number, cacheKey: string): void | Promise<void>;
abstract remove?(index: number, entity: ICachePair<any>, cacheKey: string): Promise<void>;
abstract removeAll(cacheKey: string): void | Promise<void>;
abstract addMany(entities: ICachePair<any>[], cacheKey: string): Promise<void>;
abstract removeAtIndex(index: number, cacheKey: string, ctx?: any): void | Promise<void>;
abstract remove?(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): Promise<void>;
abstract removeAll(cacheKey: string, ctx?: any): void | Promise<void>;
abstract addMany(entities: ICachePair<any>[], cacheKey: string, ctx?: any): Promise<void>;
}
16 changes: 8 additions & 8 deletions dist/cjs/common/IStorageStrategy.d.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { ICachePair } from '.';
export declare abstract class IStorageStrategy {
abstract getAll(cacheKey: string): Array<ICachePair<any>>;
abstract add(entity: ICachePair<any>, cacheKey: string): void;
abstract getAll(cacheKey: string, ctx?: any): Array<ICachePair<any>>;
abstract add(entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
/**
* @deprecated Use update instead.
*/
abstract updateAtIndex(index: number, entity: ICachePair<any>, cacheKey: string): void;
abstract update?(index: number, entity: ICachePair<any>, cacheKey: string): void;
abstract updateAtIndex(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
abstract update?(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
/**
* @deprecated Use remove instead.
*/
abstract removeAtIndex(index: number, cacheKey: string): void;
abstract remove?(index: number, entity: ICachePair<any>, cacheKey: string): void;
abstract removeAll(cacheKey: string): void;
abstract addMany(entities: ICachePair<any>[], cacheKey: string): void;
abstract removeAtIndex(index: number, cacheKey: string, ctx?: any): void;
abstract remove?(index: number, entity: ICachePair<any>, cacheKey: string, ctx?: any): void;
abstract removeAll(cacheKey: string, ctx?: any): void;
abstract addMany(entities: ICachePair<any>[], cacheKey: string, ctx?: any): void;
}
2 changes: 1 addition & 1 deletion dist/cjs/common/InMemoryStorageStrategy.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { IStorageStrategy } from './IStorageStrategy';
import { ICachePair } from '.';
export declare class InMemoryStorageStrategy extends IStorageStrategy {
private cachePairs;
add(cachePair: ICachePair<any>): void;
add(cachePair: ICachePair<any>, cacheKey: string, ctx?: any): void;
addMany(cachePairs: ICachePair<any>[]): void;
updateAtIndex(index: number, entity: ICachePair<any>): void;
update(index: number, entity: ICachePair<any>): void;
Expand Down
2 changes: 1 addition & 1 deletion dist/cjs/common/InMemoryStorageStrategy.js

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

Loading

0 comments on commit 89273d9

Please sign in to comment.