use-subscription 1.10.0-rc.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,40 +8,19 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
 
11
- 'use strict';
12
-
13
- if (process.env.NODE_ENV !== "production") {
14
- (function() {
15
- 'use strict';
16
- if (
17
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
18
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===
19
- 'function'
20
- ) {
21
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
22
- }
23
- var shim = require('use-sync-external-store/shim');
24
-
25
- //
26
- // In order to avoid removing and re-adding subscriptions each time this hook is called,
27
- // the parameters passed to this hook should be memoized in some way–
28
- // either by wrapping the entire params object with useMemo()
29
- // or by wrapping the individual callbacks with useCallback().
30
-
31
- function useSubscription(_ref) {
32
- var getCurrentValue = _ref.getCurrentValue,
33
- subscribe = _ref.subscribe;
34
- return shim.useSyncExternalStore(subscribe, getCurrentValue);
35
- }
36
-
37
- exports.useSubscription = useSubscription;
38
- if (
39
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&
40
- typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===
41
- 'function'
42
- ) {
43
- __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
44
- }
45
-
11
+ "use strict";
12
+ "production" !== process.env.NODE_ENV &&
13
+ (function () {
14
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
15
+ "function" ===
16
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
17
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
18
+ var shim = require("use-sync-external-store/shim");
19
+ exports.useSubscription = function (_ref) {
20
+ return shim.useSyncExternalStore(_ref.subscribe, _ref.getCurrentValue);
21
+ };
22
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
23
+ "function" ===
24
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
25
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
46
26
  })();
47
- }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "use-subscription",
3
3
  "description": "Reusable hooks",
4
- "version": "1.10.0-rc.0",
4
+ "version": "1.10.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/facebook/react.git",
@@ -15,12 +15,12 @@
15
15
  ],
16
16
  "license": "MIT",
17
17
  "peerDependencies": {
18
- "react": "19.0.0-rc.0"
18
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "rxjs": "^5.5.6"
22
22
  },
23
23
  "dependencies": {
24
- "use-sync-external-store": "1.4.0-rc.0"
24
+ "use-sync-external-store": "^1.4.0"
25
25
  }
26
26
  }