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

use-subscription

Package Overview
Dependencies
Maintainers
4
Versions
1832
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

use-subscription - npm Package Compare versions

Comparing version 0.0.0-experimental-0ba4698c7-20230201 to 0.0.0-experimental-0bc30748-20241028

cjs/use-subscription.production.js

55

cjs/use-subscription.development.js

@@ -11,42 +11,17 @@ /**

'use strict';
if (process.env.NODE_ENV !== "production") {
(function() {
'use strict';
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
'function'
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var shim = require('use-sync-external-store/shim');
//
// In order to avoid removing and re-adding subscriptions each time this hook is called,
// the parameters passed to this hook should be memoized in some way–
// either by wrapping the entire params object with useMemo()
// or by wrapping the individual callbacks with useCallback().
function useSubscription(_ref) {
var getCurrentValue = _ref.getCurrentValue,
subscribe = _ref.subscribe;
return shim.useSyncExternalStore(subscribe, getCurrentValue);
}
exports.useSubscription = useSubscription;
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
'function'
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
}
"use strict";
"production" !== process.env.NODE_ENV &&
(function () {
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
var shim = require("use-sync-external-store/shim");
exports.useSubscription = function (_ref) {
return shim.useSyncExternalStore(_ref.subscribe, _ref.getCurrentValue);
};
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
})();
}
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/use-subscription.production.min.js');
module.exports = require('./cjs/use-subscription.production.js');
} else {
module.exports = require('./cjs/use-subscription.development.js');
}
{
"name": "use-subscription",
"description": "Reusable hooks",
"version": "0.0.0-experimental-0ba4698c7-20230201",
"version": "0.0.0-experimental-0bc30748-20241028",
"repository": {

@@ -18,3 +18,3 @@ "type": "git",

"peerDependencies": {
"react": "0.0.0-experimental-0ba4698c7-20230201"
"react": "0.0.0-experimental-0bc30748-20241028"
},

@@ -25,4 +25,4 @@ "devDependencies": {

"dependencies": {
"use-sync-external-store": "0.0.0-experimental-0ba4698c7-20230201"
"use-sync-external-store": "0.0.0-experimental-0bc30748-20241028"
}
}

@@ -5,3 +5,3 @@ # use-subscription

**You may now migrate to [`use-sync-external-store`](https://www.npmjs.com/package/use-sync-external-store) directly instead, which has the same API as [`React.useSyncExternalStore`](https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore). The `use-subscription` package is now a thin wrapper over `use-sync-external-store` and will not be updated further.**
**You may now migrate to [`use-sync-external-store`](https://www.npmjs.com/package/use-sync-external-store) directly instead, which has the same API as [`React.useSyncExternalStore`](https://react.dev/reference/react/useSyncExternalStore). The `use-subscription` package is now a thin wrapper over `use-sync-external-store` and will not be updated further.**

@@ -8,0 +8,0 @@ # Installation

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