@bbodek/hooks 0.0.3 → 0.0.4

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.
@@ -1,9 +1,9 @@
1
- import { useLayoutEffect as d, useEffect as p, useState as u } from "react";
2
- const y = typeof window < "u" ? d : p, g = ({
1
+ import u, { useState as a } from "react";
2
+ const m = typeof window < "u" ? u.useLayoutEffect : u.useEffect, y = ({
3
3
  initialValues: c,
4
4
  validate: e
5
5
  }) => {
6
- const [s, f] = u(c), [a, r] = u({});
6
+ const [s, f] = a(c), [i, r] = a({});
7
7
  return {
8
8
  values: s,
9
9
  setValues: (o) => {
@@ -13,21 +13,21 @@ const y = typeof window < "u" ? d : p, g = ({
13
13
  r(n);
14
14
  }
15
15
  },
16
- errors: a,
16
+ errors: i,
17
17
  handleChange: (o) => {
18
18
  const { name: t, value: n } = o.target;
19
19
  if (t in c && (f({ ...s, [t]: n }), e)) {
20
- const i = e({
20
+ const d = e({
21
21
  ...s,
22
22
  [t]: n
23
23
  });
24
- r(i);
24
+ r(d);
25
25
  }
26
26
  },
27
27
  setErrors: r
28
28
  };
29
29
  };
30
30
  export {
31
- g as useForm,
32
- y as useIsomorphicLayoutEffect
31
+ y as useForm,
32
+ m as useIsomorphicLayoutEffect
33
33
  };
@@ -1,3 +1,3 @@
1
- import { useLayoutEffect } from 'react';
2
- declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
1
+ import React from "react";
2
+ declare const useIsomorphicLayoutEffect: typeof React.useLayoutEffect;
3
3
  export default useIsomorphicLayoutEffect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbodek/hooks",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"