Releases: angelnikolov/ts-cacheable
1.2.7
There was an unneeded shareReplay operator added to the observable returned by the @Cacheable decorated method which caused other calls to the method to reuse the return value of the previous call, even if it was already unsubscribed for.
This was clearly visible when you had multiple routes using async pipes subscribed to cached service methods. Basically, navigating fast through routes, would cause the async pipe to not unsubscribe from the Observable on ngDestroy which caused performance issues. Also, sometimes you could witness stale data due to the same issue.
Thanks @DrakeAnglin for reporting!
1.2.5
Before, the PCacheable
always returned asynchronously due to a Promise
wrapping I added a while ago so we support async storage strategies (Redis, IndexedDB and etc.).
I realized that this wasn't necessary and the methods should return synchronously if they were sync in the first place.
1.2.4
Added the ability to provide the promise decorator with a custom Promise implementation.
Useful for people who use AngularJS and want to use $q instead of native Promises.
1.2.3
Fixed a small issue in PCacheable
which caused errors to be swallowed and propagated to caller
1.2.2
Added IAsyncStorageStrategy
to the PCacheable
decorator.
Now you can implement your own asynchronous caching strategy for the Promise decorator only.
Possible use cases for this might include Redis, database caching and etc..
1.1.8
- Added support for custom storage strategies
- Build your own by simply extending the
IStorageStrategy
abstract class and provide it to your decorators globally or ad-hoc
- Build your own by simply extending the
- Switched on
noImplicitAny
and modified the codebase with more concrete typings - Refactored test suite and added more tests.
1.1.6
Promise cacheable decorators now have a dedicated global cache buster Subject called promiseGlobalCacheBusterNotifier
.
1.1.5
1.1.4
An issue preventing Angular CLI from building and serving in AoT was fixed.
1.1.3
Fixes:
Created a dedicated IObservableConfig
for the Cacheable
decorator which includes the async
option for decorating Observable methods.
The PCacheable
decorator does not support that option so it didn't make sense it having it in its config so now it will use the base IConfig
instead.