@aweebit/react-essentials 0.10.1 → 0.10.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.
- package/README.md +17 -17
- package/package.json +1 -1
- package/scripts/fixReadmeLinks.js +0 -23
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
const useEventListener: UseEventListener;
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
Defined in: [hooks/useEventListener.ts:135](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
23
|
+
Defined in: [hooks/useEventListener.ts:135](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L135)
|
|
24
24
|
|
|
25
25
|
Adds `handler` as a listener for the event `eventName` of `target` with the
|
|
26
26
|
provided `options` applied
|
|
@@ -71,7 +71,7 @@ function useReducerWithDeps<S, A>(
|
|
|
71
71
|
): [S, ActionDispatch<A>];
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
Defined in: [hooks/useReducerWithDeps.ts:59](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
74
|
+
Defined in: [hooks/useReducerWithDeps.ts:59](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useReducerWithDeps.ts#L59)
|
|
75
75
|
|
|
76
76
|
`useReducer` hook with an additional dependency array `deps` that resets the
|
|
77
77
|
state to `initialState` when dependencies change
|
|
@@ -214,7 +214,7 @@ function useStateWithDeps<S>(
|
|
|
214
214
|
): [S, Dispatch<SetStateAction<S>>];
|
|
215
215
|
```
|
|
216
216
|
|
|
217
|
-
Defined in: [hooks/useStateWithDeps.ts:62](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
217
|
+
Defined in: [hooks/useStateWithDeps.ts:62](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useStateWithDeps.ts#L62)
|
|
218
218
|
|
|
219
219
|
`useState` hook with an additional dependency array `deps` that resets the
|
|
220
220
|
state to `initialState` when dependencies change
|
|
@@ -344,7 +344,7 @@ Dependencies that reset the state to `initialState`
|
|
|
344
344
|
function contextualize(jsx): ContextualizePipe;
|
|
345
345
|
```
|
|
346
346
|
|
|
347
|
-
Defined in: [misc/contextualize.tsx:79](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
347
|
+
Defined in: [misc/contextualize.tsx:79](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/contextualize.tsx#L79)
|
|
348
348
|
|
|
349
349
|
An alternative way to provide context values to component trees that avoids
|
|
350
350
|
ever-increasing indentation
|
|
@@ -444,7 +444,7 @@ function createSafeContext<T>(): <DisplayName>(displayName) => {
|
|
|
444
444
|
};
|
|
445
445
|
```
|
|
446
446
|
|
|
447
|
-
Defined in: [misc/createSafeContext.ts:62](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
447
|
+
Defined in: [misc/createSafeContext.ts:62](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/createSafeContext.ts#L62)
|
|
448
448
|
|
|
449
449
|
For a given type `T`, returns a function that produces both a context of that
|
|
450
450
|
type and a hook that returns the current context value if one was provided,
|
|
@@ -589,7 +589,7 @@ A function that accepts a single string argument `displayName` (e.g.
|
|
|
589
589
|
function wrapJSX(jsx): JSXWrapPipe;
|
|
590
590
|
```
|
|
591
591
|
|
|
592
|
-
Defined in: [misc/wrapJSX.tsx:93](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
592
|
+
Defined in: [misc/wrapJSX.tsx:93](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/wrapJSX.tsx#L93)
|
|
593
593
|
|
|
594
594
|
An alternative way to compose JSX that avoids ever-increasing indentation
|
|
595
595
|
|
|
@@ -685,7 +685,7 @@ type UseEventListener = UseEventListenerWithImplicitWindowTarget &
|
|
|
685
685
|
UseEventListenerWithAnyExplicitTarget;
|
|
686
686
|
```
|
|
687
687
|
|
|
688
|
-
Defined in: [hooks/useEventListener.ts:12](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
688
|
+
Defined in: [hooks/useEventListener.ts:12](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L12)
|
|
689
689
|
|
|
690
690
|
The type of [`useEventListener`](#useeventlistener)
|
|
691
691
|
|
|
@@ -704,7 +704,7 @@ The type of [`useEventListener`](#useeventlistener)
|
|
|
704
704
|
type UseEventListenerWithImplicitWindowTarget = <K>(...args) => void;
|
|
705
705
|
```
|
|
706
706
|
|
|
707
|
-
Defined in: [hooks/useEventListener.ts:21](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
707
|
+
Defined in: [hooks/useEventListener.ts:21](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L21)
|
|
708
708
|
|
|
709
709
|
### Type Parameters
|
|
710
710
|
|
|
@@ -772,7 +772,7 @@ type UseEventListenerWithExplicitGlobalTarget =
|
|
|
772
772
|
UseEventListenerWithExplicitTarget<MathMLElement, MathMLElementEventMap>;
|
|
773
773
|
```
|
|
774
774
|
|
|
775
|
-
Defined in: [hooks/useEventListener.ts:32](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
775
|
+
Defined in: [hooks/useEventListener.ts:32](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L32)
|
|
776
776
|
|
|
777
777
|
### See
|
|
778
778
|
|
|
@@ -789,7 +789,7 @@ type UseEventListenerWithExplicitTarget<Target, EventMap> = <T, K>(
|
|
|
789
789
|
) => void;
|
|
790
790
|
```
|
|
791
791
|
|
|
792
|
-
Defined in: [hooks/useEventListener.ts:44](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
792
|
+
Defined in: [hooks/useEventListener.ts:44](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L44)
|
|
793
793
|
|
|
794
794
|
### Type Parameters
|
|
795
795
|
|
|
@@ -888,7 +888,7 @@ type UseEventListenerWithAnyExplicitTarget = UseEventListenerWithExplicitTarget<
|
|
|
888
888
|
>;
|
|
889
889
|
```
|
|
890
890
|
|
|
891
|
-
Defined in: [hooks/useEventListener.ts:56](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
891
|
+
Defined in: [hooks/useEventListener.ts:56](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L56)
|
|
892
892
|
|
|
893
893
|
### See
|
|
894
894
|
|
|
@@ -909,7 +909,7 @@ type UseEventListenerWithImplicitWindowTargetArgs<K> =
|
|
|
909
909
|
: never;
|
|
910
910
|
```
|
|
911
911
|
|
|
912
|
-
Defined in: [hooks/useEventListener.ts:64](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
912
|
+
Defined in: [hooks/useEventListener.ts:64](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L64)
|
|
913
913
|
|
|
914
914
|
### Type Parameters
|
|
915
915
|
|
|
@@ -954,7 +954,7 @@ type UseEventListenerWithExplicitTargetArgs<EventMap, T, K> = [
|
|
|
954
954
|
];
|
|
955
955
|
```
|
|
956
956
|
|
|
957
|
-
Defined in: [hooks/useEventListener.ts:78](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
957
|
+
Defined in: [hooks/useEventListener.ts:78](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/hooks/useEventListener.ts#L78)
|
|
958
958
|
|
|
959
959
|
### Type Parameters
|
|
960
960
|
|
|
@@ -1004,7 +1004,7 @@ type ContextualizePipe = {
|
|
|
1004
1004
|
};
|
|
1005
1005
|
```
|
|
1006
1006
|
|
|
1007
|
-
Defined in: [misc/contextualize.tsx:13](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
1007
|
+
Defined in: [misc/contextualize.tsx:13](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/contextualize.tsx#L13)
|
|
1008
1008
|
|
|
1009
1009
|
The return type of [`contextualize`](#contextualize)
|
|
1010
1010
|
|
|
@@ -1058,7 +1058,7 @@ The return type of [`contextualize`](#contextualize)
|
|
|
1058
1058
|
type ContextualizeWith = <T>(Context, value) => ContextualizePipe;
|
|
1059
1059
|
```
|
|
1060
1060
|
|
|
1061
|
-
Defined in: [misc/contextualize.tsx:23](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
1061
|
+
Defined in: [misc/contextualize.tsx:23](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/contextualize.tsx#L23)
|
|
1062
1062
|
|
|
1063
1063
|
### Type Parameters
|
|
1064
1064
|
|
|
@@ -1136,7 +1136,7 @@ type JSXWrapPipe = {
|
|
|
1136
1136
|
};
|
|
1137
1137
|
```
|
|
1138
1138
|
|
|
1139
|
-
Defined in: [misc/wrapJSX.tsx:17](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
1139
|
+
Defined in: [misc/wrapJSX.tsx:17](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/wrapJSX.tsx#L17)
|
|
1140
1140
|
|
|
1141
1141
|
The return type of [`wrapJSX`](#wrapjsx)
|
|
1142
1142
|
|
|
@@ -1190,7 +1190,7 @@ The return type of [`wrapJSX`](#wrapjsx)
|
|
|
1190
1190
|
type WrapJSXWith = <C>(...args) => JSXWrapPipe;
|
|
1191
1191
|
```
|
|
1192
1192
|
|
|
1193
|
-
Defined in: [misc/wrapJSX.tsx:27](https://github.com/aweebit/react-essentials/blob/v0.10.
|
|
1193
|
+
Defined in: [misc/wrapJSX.tsx:27](https://github.com/aweebit/react-essentials/blob/v0.10.3/src/misc/wrapJSX.tsx#L27)
|
|
1194
1194
|
|
|
1195
1195
|
### Type Parameters
|
|
1196
1196
|
|
package/package.json
CHANGED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readFile, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
|
|
4
|
-
const rootDir = join(import.meta.dirname, '..');
|
|
5
|
-
|
|
6
|
-
const headerPath = join(rootDir, 'README-header.md');
|
|
7
|
-
const readmePath = join(rootDir, 'README.md');
|
|
8
|
-
|
|
9
|
-
const header = await readFile(headerPath, 'utf8');
|
|
10
|
-
const readme = await readFile(readmePath, 'utf8');
|
|
11
|
-
|
|
12
|
-
const newReadme =
|
|
13
|
-
header +
|
|
14
|
-
readme
|
|
15
|
-
.slice(header.length)
|
|
16
|
-
.replaceAll(
|
|
17
|
-
/\(#useeventlistener((?:-1)?)\)/g,
|
|
18
|
-
(match, /** @type {string} */ suffix) => {
|
|
19
|
-
return `(#useeventlistener${suffix ? '' : '-1'})`;
|
|
20
|
-
},
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
await writeFile(readmePath, newReadme);
|