@@ -11,12 +11,11 @@ The current storage methods are:
11
11
12
12
## Prerequisites
13
13
14
- Enable ` emitDecoratorMetadata ` and ` experimentalDecorators ` in your ` tsconfig.json `
14
+ Enable ` experimentalDecorators ` in your ` tsconfig.json `
15
15
16
16
{
17
17
"compilerOptions": {
18
- ...
19
- "emitDecoratorMetadata": true,
18
+ ...,
20
19
"experimentalDecorators": true
21
20
}
22
21
}
@@ -49,7 +48,7 @@ value is cached
49
48
## Limitations
50
49
51
50
It's not possible to store complex objects using ` StorageCache ` or ` SessionCache ` , like it is using ` MemoryCache ` . If
52
- the object stored has methods or any other fancy stuff, this will likely not work.
51
+ the object stored has methods or any other fancy stuff, this will most likely not work.
53
52
54
53
As for now, the only complex return types possible for cache based on Storage is a ` Promise ` .
55
54
@@ -169,7 +168,7 @@ has a mandatory input which can be a key, or a `CacheOptions` object. If you def
169
168
these values will be used as default values for the method decorators.
170
169
171
170
172
- ###` @MemoryCache ` usage with ` @CacheContainer ` , ` CacheOptions ` and the ` MethodCacheService ` :
171
+ ### ` @MemoryCache ` usage with ` @CacheContainer ` , ` CacheOptions ` and the ` MethodCacheService ` :
173
172
174
173
175
174
@CacheContainer({key: 'TestContainer', ttl: 1})
@@ -226,7 +225,7 @@ only twice, because this cache expires after 5 seconds.
226
225
227
226
The ` clearMemoryContainer ` clears all the cache present in the ` CacheContainer ` .
228
227
229
- ###` @SessionCache(options: CacheOptions | string) `
228
+ ### ` @SessionCache(options: CacheOptions | string) `
230
229
231
230
This uses the browser's native ` SessionStorage ` . Therefor it is limited to the browser environment only. And with it comes
232
231
the limitations of storage. You can only store static objects or Promises using this decorator. To store a promise, set
@@ -236,6 +235,6 @@ You can also set the `returnType` as part of a `CacheContainer`. A method decora
236
235
237
236
The rest is the same as ` @MethodCache `
238
237
239
- ###` @StorageCache(options: CacheOptions | string) `
238
+ ### ` @StorageCache(options: CacheOptions | string) `
240
239
The same as ` @SessionCache ` , but instead of the browser's native ` SessionStorage ` it uses the ` LocalStorage ` of the
241
240
browser. This can only be used inside the browser.
0 commit comments