react-simplikit 0.0.13 → 0.0.15

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,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default, { ElementType, Ref } from 'react';
2
+ import { ElementType, Ref, ReactNode } from 'react';
3
3
  import { UseImpressionRefOptions } from '../../hooks/useImpressionRef/index.cjs';
4
4
 
5
- type Props<Tag extends ElementType> = React__default.ComponentPropsWithoutRef<Tag> & UseImpressionRefOptions & {
5
+ type Props<Tag extends ElementType> = React.ComponentPropsWithoutRef<Tag> & UseImpressionRefOptions & {
6
6
  as?: Tag;
7
7
  ref?: Ref<HTMLElement>;
8
- children?: React__default.ReactNode;
8
+ children?: ReactNode;
9
9
  className?: string;
10
10
  };
11
11
  /**
@@ -131,9 +131,10 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
131
131
  function useThrottle(callback, wait, options) {
132
132
  const preservedCallback = usePreservedCallback(callback);
133
133
  const preservedOptions = usePreservedReference(options ?? {});
134
- const throttledCallback = (0, import_react3.useMemo)(() => {
135
- return throttle(preservedCallback, wait, preservedOptions);
136
- }, [preservedOptions, preservedCallback, wait]);
134
+ const throttledCallback = (0, import_react3.useMemo)(
135
+ () => throttle(preservedCallback, wait, preservedOptions),
136
+ [preservedOptions, preservedCallback, wait]
137
+ );
137
138
  (0, import_react3.useEffect)(() => {
138
139
  return () => {
139
140
  throttledCallback.cancel();
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import * as react from 'react';
2
2
 
3
3
  /**
4
4
  * @description
@@ -25,6 +25,6 @@ import * as React from 'react';
25
25
  * );
26
26
  * }
27
27
  */
28
- declare function useToggle(initialValue?: boolean): [boolean, React.ActionDispatch<[]>];
28
+ declare function useToggle(initialValue?: boolean): [boolean, react.ActionDispatch<[]>];
29
29
 
30
30
  export { useToggle };
package/dist/index.cjs CHANGED
@@ -696,9 +696,10 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
696
696
  function useThrottle(callback, wait, options) {
697
697
  const preservedCallback = usePreservedCallback(callback);
698
698
  const preservedOptions = usePreservedReference(options ?? {});
699
- const throttledCallback = (0, import_react20.useMemo)(() => {
700
- return throttle(preservedCallback, wait, preservedOptions);
701
- }, [preservedOptions, preservedCallback, wait]);
699
+ const throttledCallback = (0, import_react20.useMemo)(
700
+ () => throttle(preservedCallback, wait, preservedOptions),
701
+ [preservedOptions, preservedCallback, wait]
702
+ );
702
703
  (0, import_react20.useEffect)(() => {
703
704
  return () => {
704
705
  throttledCallback.cancel();
@@ -1,11 +1,11 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React__default, { ElementType, Ref } from 'react';
2
+ import { ElementType, Ref, ReactNode } from 'react';
3
3
  import { UseImpressionRefOptions } from '../../hooks/useImpressionRef/index.js';
4
4
 
5
- type Props<Tag extends ElementType> = React__default.ComponentPropsWithoutRef<Tag> & UseImpressionRefOptions & {
5
+ type Props<Tag extends ElementType> = React.ComponentPropsWithoutRef<Tag> & UseImpressionRefOptions & {
6
6
  as?: Tag;
7
7
  ref?: Ref<HTMLElement>;
8
- children?: React__default.ReactNode;
8
+ children?: ReactNode;
9
9
  className?: string;
10
10
  };
11
11
  /**
@@ -105,9 +105,10 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
105
105
  function useThrottle(callback, wait, options) {
106
106
  const preservedCallback = usePreservedCallback(callback);
107
107
  const preservedOptions = usePreservedReference(options ?? {});
108
- const throttledCallback = useMemo2(() => {
109
- return throttle(preservedCallback, wait, preservedOptions);
110
- }, [preservedOptions, preservedCallback, wait]);
108
+ const throttledCallback = useMemo2(
109
+ () => throttle(preservedCallback, wait, preservedOptions),
110
+ [preservedOptions, preservedCallback, wait]
111
+ );
111
112
  useEffect2(() => {
112
113
  return () => {
113
114
  throttledCallback.cancel();
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import * as react from 'react';
2
2
 
3
3
  /**
4
4
  * @description
@@ -25,6 +25,6 @@ import * as React from 'react';
25
25
  * );
26
26
  * }
27
27
  */
28
- declare function useToggle(initialValue?: boolean): [boolean, React.ActionDispatch<[]>];
28
+ declare function useToggle(initialValue?: boolean): [boolean, react.ActionDispatch<[]>];
29
29
 
30
30
  export { useToggle };
package/esm/index.js CHANGED
@@ -647,9 +647,10 @@ function throttle(func, throttleMs, { edges = ["leading", "trailing"] } = {}) {
647
647
  function useThrottle(callback, wait, options) {
648
648
  const preservedCallback = usePreservedCallback(callback);
649
649
  const preservedOptions = usePreservedReference(options ?? {});
650
- const throttledCallback = useMemo6(() => {
651
- return throttle(preservedCallback, wait, preservedOptions);
652
- }, [preservedOptions, preservedCallback, wait]);
650
+ const throttledCallback = useMemo6(
651
+ () => throttle(preservedCallback, wait, preservedOptions),
652
+ [preservedOptions, preservedCallback, wait]
653
+ );
653
654
  useEffect11(() => {
654
655
  return () => {
655
656
  throttledCallback.cancel();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-simplikit",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "main": "./dist/index.cjs",
5
5
  "type": "module",
6
6
  "sideEffects": false,