UNPKG

@aurelia/fetch-client

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-%230074c1.svg)](http://www.typescriptlang.org/) [![CircleCI](https://circleci.com/

15 lines (12 loc) 579 B
import { DI } from '@aurelia/kernel'; import { ICacheItem } from './cach-service'; import { MemoryStorage } from './storage-memory'; export interface ICacheStorage { delete: (key: string) => void; /** Returns true if there's a value associated with the given key */ has: (key: string) => boolean; set: <T = unknown>(key: string, value: ICacheItem<T>) => void; get: <T = unknown>(key: string) => ICacheItem<T> | undefined; clear: () => void; } export const ICacheStorage = /*@__PURE__*/DI.createInterface<ICacheStorage>(x => x.singleton(MemoryStorage));