New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

swr

Package Overview
Dependencies
Maintainers
8
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swr - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

7

package.json
{
"name": "swr",
"version": "2.1.1",
"version": "2.1.2",
"description": "React Hooks library for remote data fetching",

@@ -110,3 +110,3 @@ "keywords": [

"@playwright/test": "^1.30.0",
"swr": "2.1.1"
"swr": "2.1.2"
},

@@ -124,5 +124,2 @@ "peerDependencies": {

},
"engines": {
"pnpm": "7"
},
"dependencies": {

@@ -129,0 +126,0 @@ "use-sync-external-store": "^1.2.0"

import { Key, SWRConfiguration, Middleware } from 'swr';
type SWRSubscription<Data = any, Error = any> = (key: Key, { next }: {
type SWRSubscriptionOptions<Data = any, Error = any> = {
next: (err?: Error | null, data?: Data) => void;
}) => () => void;
};
type SWRSubscription<SWRSubKey extends Key = Key, Data = any, Error = any> = SWRSubKey extends () => infer Arg | null | undefined | false ? (key: Arg, { next }: SWRSubscriptionOptions<Data, Error>) => void : SWRSubKey extends null | undefined | false ? never : SWRSubKey extends infer Arg ? (key: Arg, { next }: SWRSubscriptionOptions<Data, Error>) => void : never;
type SWRSubscriptionResponse<Data = any, Error = any> = {

@@ -10,3 +11,4 @@ data?: Data;

};
type SWRSubscriptionHook<Data = any, Error = any> = (key: Key, subscribe: SWRSubscription<Data, Error>, config?: SWRConfiguration) => SWRSubscriptionResponse<Data, Error>;
type SWRSubscriptionHook = <Data = any, Error = any, SWRSubKey extends Key = Key>(key: SWRSubKey, subscribe: SWRSubscription<SWRSubKey, Data, Error>, config?: SWRConfiguration) => SWRSubscriptionResponse<Data, Error>;
declare const subscription: Middleware;

@@ -28,4 +30,4 @@ /**

*/
declare const useSWRSubscription: SWRSubscriptionHook<any, any>;
declare const useSWRSubscription: SWRSubscriptionHook;
export { SWRSubscription, SWRSubscriptionHook, SWRSubscriptionResponse, useSWRSubscription as default, subscription };
export { SWRSubscription, SWRSubscriptionHook, SWRSubscriptionOptions, SWRSubscriptionResponse, useSWRSubscription as default, subscription };
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