@hrnec06/react_utils 1.3.5 → 1.4.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hrnec06/react_utils",
3
- "version": "1.3.5",
3
+ "version": "1.4.0",
4
4
  "description": "A debugger component for react.",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
package/src/index.ts CHANGED
@@ -14,6 +14,8 @@ import useLazySignal, { LazySignal } from "./hooks/useLazySignal";
14
14
  import Debugger from './components/Debugger/Debugger';
15
15
  import ResizeableBox from "./components/ResizeableBox/ResizeableBox";
16
16
 
17
+ import * as util from './lib/utils';
18
+
17
19
  export {
18
20
  useKeyListener,
19
21
  useListener,
@@ -32,4 +34,6 @@ export {
32
34
 
33
35
  Debugger,
34
36
  ResizeableBox,
37
+
38
+ util
35
39
  };
@@ -0,0 +1,8 @@
1
+ import { Vector2, Vector3 } from "@hrnec06/util";
2
+
3
+ export function vectorToTransform(vector: Vector2 | Vector3): string
4
+ {
5
+ const values = vector.reduce((prev, curr, ix) => prev + (ix ? ', ' : '') + curr + 'px', '');
6
+
7
+ return 'translate(' + values + ')';
8
+ }