This is a simple example of how a cache can be implemented using decorators. In this case, Ionic capacitor was used as the storage implementation.
This code has not been tested in production environment. If you wish to improve on this example submit a PR.