nextAdapter
●tagtree · /next·function
Creates a that binds tagtree's cache lifecycle to the
Next.js data cache, so consumers call wrap and invalidate without managing
unstable_cache or revalidateTag directly.
Signature
function nextAdapter(): CacheAdapter;Returns
A CacheAdapter whose wrap delegates to unstable_cache and whose
invalidate calls revalidateTag per tag in 'max' mode.
Example
import { createCacheInstance, defineCache } from '@tagtree/core';
import { nextAdapter } from '@tagtree/next';
const shopifySchema = defineCache({ namespace: 'shopify', entities: {} });
const cache = createCacheInstance(shopifySchema, nextAdapter());MetadataOpen in GitHub ↗