Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@suspensive/cache

Package Overview
Dependencies
Maintainers
0
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@suspensive/cache - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

dist/chunk-RN456Z2W.js

6

dist/cacheOptions.d.ts

@@ -1,2 +0,2 @@

import { CacheKey, CacheOptions } from './types.js';
import { CacheKey, CacheOptions, DataTag } from './types.js';

@@ -6,4 +6,6 @@ /**

*/
declare function cacheOptions<TData, TCacheKey extends CacheKey>(options: CacheOptions<TData, TCacheKey>): CacheOptions<TData, TCacheKey>;
declare function cacheOptions<TData, TCacheKey extends CacheKey>(options: CacheOptions<TData, TCacheKey>): CacheOptions<TData, TCacheKey> & {
cacheKey: DataTag<TCacheKey, TData>;
};
export { cacheOptions };
"use client"
import {
cacheOptions
} from "./chunk-RYZ2WLOI.js";
} from "./chunk-RN456Z2W.js";
import "./chunk-QETBZSG5.js";

@@ -6,0 +6,0 @@ export {

@@ -13,3 +13,3 @@ "use client"

cacheOptions
} from "./chunk-RYZ2WLOI.js";
} from "./chunk-RN456Z2W.js";
import {

@@ -16,0 +16,0 @@ useCache

@@ -7,3 +7,3 @@ type Tuple<TItem = unknown> = TItem[] | readonly TItem[];

*/
type CacheOptions<TData, TCacheKey extends CacheKey> = {
interface CacheOptions<TData, TCacheKey extends CacheKey> {
cacheKey: TCacheKey;

@@ -13,4 +13,8 @@ cacheFn: (options: {

}) => Promise<TData>;
}
declare const dataTagSymbol: unique symbol;
type DataTag<TType, TValue> = TType & {
[dataTagSymbol]: TValue;
};
export type { CacheKey, CacheOptions };
export { type CacheKey, type CacheOptions, type DataTag, dataTagSymbol };
{
"name": "@suspensive/cache",
"version": "0.1.0",
"version": "0.2.0",
"description": "Useful interfaces for React Suspense",

@@ -46,4 +46,4 @@ "keywords": [

"@suspensive/eslint-config": "0.0.0",
"@suspensive/react": "2.6.2",
"@suspensive/test-utils": "0.0.0",
"@suspensive/react": "2.6.2",
"@suspensive/tsconfig": "0.0.0-development",

@@ -50,0 +50,0 @@ "@suspensive/tsup": "0.0.0"

@@ -1,2 +0,2 @@

import type { CacheKey, CacheOptions } from './types'
import type { CacheKey, CacheOptions, DataTag } from './types'

@@ -8,4 +8,11 @@ /**

options: CacheOptions<TData, TCacheKey>
): CacheOptions<TData, TCacheKey> {
): CacheOptions<TData, TCacheKey> & {
cacheKey: DataTag<TCacheKey, TData>
}
/**
* @experimental This is experimental feature.
*/
export function cacheOptions(options: unknown) {
return options
}

@@ -8,5 +8,10 @@ import type { Tuple } from './utility-types'

*/
export type CacheOptions<TData, TCacheKey extends CacheKey> = {
export interface CacheOptions<TData, TCacheKey extends CacheKey> {
cacheKey: TCacheKey
cacheFn: (options: { cacheKey: TCacheKey }) => Promise<TData>
}
export declare const dataTagSymbol: unique symbol
export type DataTag<TType, TValue> = TType & {
[dataTagSymbol]: TValue
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc