use-subscription 1.9.0-next-fa4314841-20230502 → 1.10.0-canary-2b036d3f1-20240327

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.
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license React
3
+ * use-subscription.production.min.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */
10
+
11
+ 'use strict';
12
+
13
+ var shim = require('use-sync-external-store/shim');
14
+
15
+ //
16
+ // In order to avoid removing and re-adding subscriptions each time this hook is called,
17
+ // the parameters passed to this hook should be memoized in some way–
18
+ // either by wrapping the entire params object with useMemo()
19
+ // or by wrapping the individual callbacks with useCallback().
20
+
21
+ function useSubscription(_ref) {
22
+ let getCurrentValue = _ref.getCurrentValue,
23
+ subscribe = _ref.subscribe;
24
+ return shim.useSyncExternalStore(subscribe, getCurrentValue);
25
+ }
26
+
27
+ exports.useSubscription = useSubscription;
@@ -1,10 +1,12 @@
1
- /**
2
- * @license React
3
- * use-subscription.production.min.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
1
+ /*
2
+ React
3
+ use-subscription.production.min.js
4
+
5
+ Copyright (c) Meta Platforms, Inc. and affiliates.
6
+
7
+ This source code is licensed under the MIT license found in the
8
+ LICENSE file in the root directory of this source tree.
9
+ */
10
10
  'use strict';var b=require("use-sync-external-store/shim");exports.useSubscription=function(a){return b.useSyncExternalStore(a.subscribe,a.getCurrentValue)};
11
+
12
+ //# sourceMappingURL=use-subscription.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-subscription.production.min.js","lineCount":10,"mappings":"A;;;;;;;;;aAYA,IAAIA,EAAOC,OAAA,CAAQ,8BAAR,CAcXC,QAAQC,CAAAA,eAAR,CANAA,QAAwB,CAACC,CAAD,CAAO,CAG7B,MAAOJ,EAAKK,CAAAA,oBAAL,CADSD,CAAKE,CAAAA,SACd,CAFeF,CAAKG,CAAAA,eAEpB,CAHsB;","sources":["use-subscription.production.js"],"names":["shim","require","exports","useSubscription","_ref","useSyncExternalStore","subscribe","getCurrentValue"],"ignoreList":[0]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "use-subscription",
3
3
  "description": "Reusable hooks",
4
- "version": "1.9.0-next-fa4314841-20230502",
4
+ "version": "1.10.0-canary-2b036d3f1-20240327",
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": "18.3.0-next-fa4314841-20230502"
18
+ "react": "19.0.0-canary-2b036d3f1-20240327"
19
19
  },
20
20
  "devDependencies": {
21
21
  "rxjs": "^5.5.6"
22
22
  },
23
23
  "dependencies": {
24
- "use-sync-external-store": "1.3.0-next-fa4314841-20230502"
24
+ "use-sync-external-store": "1.4.0-canary-2b036d3f1-20240327"
25
25
  }
26
26
  }