@soluble/cache-interop
TypeScript icon, indicating that this package has built-in type declarations

0.12.8 • Public • Published

@soluble/cache-interop

Interoperability cache contracts and utilities.

Codecov Downloads Size Codecov Codefactor CodeClimate TechDebt Typings Licence

About | Documentation

Package holding cache-interop contracts. You may want to look for official adapter implementations instead.

Install

$ yarn add @soluble/cache-interop

Interfaces

CacheInterface

import {
  CacheInterface,
  ConnectedCacheInterface,
} from "@soluble/cache-interop";

class MyCache implements CacheInterface, ConnectedCacheInterface {
  //...
}

Utilities

Guards

Typescript typeguards

import { Guards } from "@soluble/cache-interop";

if (Guards.isConnectedCache(cache)) {
  await cache.getConnection().quit();
}

Guards.isValidCacheKey(key);

Guards.isCacheValueProviderFn(async () => {});

Guards.isNonEmptyString("Hi!");

Asserts

Typescript assertions

import { Asserts } from "@soluble/cache-interop";

Asserts.assertValidCacheKey(key);

Sponsors ❤️

If you are enjoying some of my OSS guides or libs for your company, I'd really appreciate a sponsorship, a coffee or a dropped star. That gives me a tasty morning boost and help me to make some of my ideas come true 🙏

Special thanks

Jetbrains logo Jetbrains logo
JetBrains Embie.be

/@soluble/cache-interop/

    Package Sidebar

    Install

    npm i @soluble/cache-interop

    Weekly Downloads

    527

    Version

    0.12.8

    License

    MIT

    Unpacked Size

    150 kB

    Total Files

    9

    Last publish

    Collaborators

    • s.vanvelthem