• A class decorator that defines the global cache store

    Parameters

    • container: {} = defaultContainer

      Object that stores injectables

      Returns ClassDecorator<Class<AnnotatedCacheStorage>>

      See

      AnnotatedCacheStorage for interface definition

      Example

      import { AnnotatedCacheStorage, CacheStorage } from "@fork-git-it/annotatedjs";

      @CacheStorage()
      export class ExampleCacheStorage implements AnnotatedCacheStorage {
      has(cacheName: string) {
      // caches is the global CacheStorage in browser runtimes
      return caches.has(cacheName);
      }

      open(cacheName: string) {
      return caches.open(cacheName);
      }

      delete(cacheName: string) {
      return caches.delete(cacheName);
      }
      }

    Generated using TypeDoc