angelnikolov / ts-cacheable

Observable/Promise Cache Decorator
https://npmjs.com/package/ts-cacheable
ISC License
340 stars 42 forks source link

Promise support #24

Closed angelnikolov closed 5 years ago

angelnikolov commented 5 years ago

I have added Promise support to the library. Basically, you can use the decorators, the same way you have till now, with the only difference that where you'd want to cache a Promise method, you'd use @PCacheable and @PCacheBuster. Everything else stays the same.

Where would one use this

In FE applications where it's not a common practice to use RxJs (React, Vue, Aurelia) In your node server as an in-memory caching layer