@nascentdigital/funnel-ui 5.0.2 → 5.0.3

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.
@@ -16,6 +16,7 @@ export * from './useLock';
16
16
  export * from './useMixedResponsiveValue';
17
17
  export * from './usePathname';
18
18
  export * from './useRefElement';
19
+ export * from './useRefValue';
19
20
  export * from './useRefresh';
20
21
  export * from './useResizeObserver';
21
22
  export * from './useResponsiveValue';
@@ -32,6 +32,7 @@ __exportStar(require("./useLock"), exports);
32
32
  __exportStar(require("./useMixedResponsiveValue"), exports);
33
33
  __exportStar(require("./usePathname"), exports);
34
34
  __exportStar(require("./useRefElement"), exports);
35
+ __exportStar(require("./useRefValue"), exports);
35
36
  __exportStar(require("./useRefresh"), exports);
36
37
  __exportStar(require("./useResizeObserver"), exports);
37
38
  __exportStar(require("./useResponsiveValue"), exports);
@@ -0,0 +1,2 @@
1
+ import { Callback } from '@nascentdigital/funnel-core';
2
+ export declare function useRefValue<TRef>(): [Callback<TRef | null>, TRef | null];
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useRefValue = useRefValue;
4
+ const react_1 = require("react");
5
+ // hook
6
+ function useRefValue() {
7
+ // create state
8
+ const [value, setValue] = (0, react_1.useState)(null);
9
+ // create ref callback function
10
+ const setRef = (0, react_1.useCallback)((value) => {
11
+ setValue(value);
12
+ }, []);
13
+ // return state and setter
14
+ return [setRef, value];
15
+ }
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@nascentdigital/funnel-ui",
3
3
  "description": "UI components for funnel",
4
- "version": "5.0.2",
4
+ "version": "5.0.3",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
7
- "access": "restricted"
7
+ "access": "public"
8
8
  },
9
9
  "repository": {
10
10
  "url": "git+https://github.com/nascentdigital/funnel.git",
@@ -69,5 +69,5 @@
69
69
  "react-dom": "^19",
70
70
  "ts-jest": "^29.3.2"
71
71
  },
72
- "gitHead": "24d9690cf813052f6561c3ccef11c7cf69ad7f7c"
72
+ "gitHead": "0d1cc7d78504e8819998d928ffb342d622f75690"
73
73
  }