@faasjs/react 8.0.0-beta.3 → 8.0.0-beta.31
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 +13 -69
- package/dist/index.d.ts +855 -455
- package/dist/index.mjs +1396 -710
- package/package.json +19 -23
- package/dist/index.cjs +0 -769
package/README.md
CHANGED
|
@@ -1,56 +1,15 @@
|
|
|
1
1
|
# @faasjs/react
|
|
2
2
|
|
|
3
|
-
React plugin for FaasJS.
|
|
4
|
-
|
|
5
|
-
[](https://github.com/faasjs/faasjs/blob/main/packages/react/LICENSE)
|
|
6
|
-
[](https://www.npmjs.com/package/@faasjs/react)
|
|
7
|
-
|
|
8
|
-
**If you use [SWR](https://swr.vercel.app) or [React Query / TanStack Query](https://tanstack.com/query), please use [`@faasjs/browser`](https://faasjs.com/doc/browser) directly.**
|
|
9
|
-
|
|
10
|
-
## Features
|
|
11
|
-
|
|
12
|
-
- Support [FaasJS Request Specifications](https://faasjs.com/guide/request-spec.html).
|
|
13
|
-
- Support global and per-request configurations.
|
|
14
|
-
- Compatible with [why-did-you-render](https://github.com/welldone-software/why-did-you-render).
|
|
15
|
-
- Additional React functions:
|
|
16
|
-
- Utils:
|
|
17
|
-
- [equal](functions/equal.md): Compare two values for deep equality.
|
|
18
|
-
- [createSplittingContext](functions/createSplittingContext.md): Create a context for code splitting.
|
|
19
|
-
- [splittingState](functions/splittingState.md): Create a splitting states.
|
|
20
|
-
- Hooks:
|
|
21
|
-
- [useEqualMemoize](functions/useEqualMemoize.md): Memoize a value with deep equality.
|
|
22
|
-
- [useEqualEffect](functions/useEqualEffect.md): Run an effect with deep equality.
|
|
23
|
-
- [useEqualMemo](functions/useEqualMemo.md): Memoize a value with deep equality.
|
|
24
|
-
- [useEqualCallback](functions/useEqualCallback.md): Memoize a callback with deep equality.
|
|
25
|
-
- [useConstant](functions/useConstant.md): Create a constant value with hooks.
|
|
26
|
-
- [usePrevious](functions/usePrevious.md): Get the previous value of a state.
|
|
27
|
-
- [useStateRef](functions/useStateRef.md): Create a state with a ref.
|
|
28
|
-
- Components:
|
|
29
|
-
- [OptionalWrapper](functions/OptionalWrapper.md): Render a component optionally.
|
|
30
|
-
- [ErrorBoundary](classes/ErrorBoundary.md): Catch errors in the component tree.
|
|
31
|
-
- Fetch Data:
|
|
32
|
-
- [faas](functions/faas.md): Fetch data from FaasJS.
|
|
33
|
-
- [useFaas](functions/useFaas.md): Fetch data from FaasJS with hooks.
|
|
34
|
-
- [useFaasStream](functions/useFaasStream.md): Fetch streaming data from FaasJS with hooks.
|
|
35
|
-
- [FaasDataWrapper](functions/FaasDataWrapper.md): Fetch data from FaasJS with a wrapper component.
|
|
36
|
-
- [withFaasData](functions/withFaasData.md): Fetch data from FaasJS using a higher-order component (HOC).
|
|
37
|
-
|
|
38
|
-
## Install
|
|
39
|
-
|
|
40
|
-
```sh
|
|
41
|
-
npm install @faasjs/react react
|
|
42
|
-
```
|
|
43
|
-
|
|
44
3
|
## Functions
|
|
45
4
|
|
|
46
5
|
- [createSplittingContext](functions/createSplittingContext.md)
|
|
47
6
|
- [equal](functions/equal.md)
|
|
48
7
|
- [faas](functions/faas.md)
|
|
49
8
|
- [FaasReactClient](functions/FaasReactClient.md)
|
|
50
|
-
- [
|
|
51
|
-
- [FormItem](functions/FormItem.md)
|
|
9
|
+
- [generateId](functions/generateId.md)
|
|
52
10
|
- [getClient](functions/getClient.md)
|
|
53
11
|
- [OptionalWrapper](functions/OptionalWrapper.md)
|
|
12
|
+
- [setMock](functions/setMock.md)
|
|
54
13
|
- [useConstant](functions/useConstant.md)
|
|
55
14
|
- [useEqualCallback](functions/useEqualCallback.md)
|
|
56
15
|
- [useEqualEffect](functions/useEqualEffect.md)
|
|
@@ -61,57 +20,42 @@ npm install @faasjs/react react
|
|
|
61
20
|
- [usePrevious](functions/usePrevious.md)
|
|
62
21
|
- [useSplittingState](functions/useSplittingState.md)
|
|
63
22
|
- [useStateRef](functions/useStateRef.md)
|
|
64
|
-
- [validValues](functions/validValues.md)
|
|
65
23
|
- [withFaasData](functions/withFaasData.md)
|
|
66
24
|
|
|
67
25
|
## Classes
|
|
68
26
|
|
|
69
27
|
- [ErrorBoundary](classes/ErrorBoundary.md)
|
|
28
|
+
- [FaasBrowserClient](classes/FaasBrowserClient.md)
|
|
29
|
+
- [Response](classes/Response.md)
|
|
30
|
+
- [ResponseError](classes/ResponseError.md)
|
|
70
31
|
|
|
71
32
|
## Interfaces
|
|
72
33
|
|
|
73
34
|
- [ErrorBoundaryProps](interfaces/ErrorBoundaryProps.md)
|
|
74
|
-
- [Response](interfaces/Response.md)
|
|
75
|
-
- [ResponseError](interfaces/ResponseError.md)
|
|
76
35
|
|
|
77
36
|
## Type Aliases
|
|
78
37
|
|
|
38
|
+
- [BaseUrl](type-aliases/BaseUrl.md)
|
|
79
39
|
- [ErrorChildrenProps](type-aliases/ErrorChildrenProps.md)
|
|
80
|
-
- [
|
|
81
|
-
- [FaasActionUnionType](type-aliases/FaasActionUnionType.md)
|
|
82
|
-
- [FaasData](type-aliases/FaasData.md)
|
|
40
|
+
- [FaasBrowserClientAction](type-aliases/FaasBrowserClientAction.md)
|
|
83
41
|
- [FaasDataInjection](type-aliases/FaasDataInjection.md)
|
|
84
42
|
- [FaasDataWrapperProps](type-aliases/FaasDataWrapperProps.md)
|
|
85
43
|
- [FaasDataWrapperRef](type-aliases/FaasDataWrapperRef.md)
|
|
86
|
-
- [FaasParams](type-aliases/FaasParams.md)
|
|
87
44
|
- [FaasReactClientInstance](type-aliases/FaasReactClientInstance.md)
|
|
88
45
|
- [FaasReactClientOptions](type-aliases/FaasReactClientOptions.md)
|
|
89
|
-
- [
|
|
90
|
-
- [FormContextProps](type-aliases/FormContextProps.md)
|
|
91
|
-
- [FormDefaultRulesOptions](type-aliases/FormDefaultRulesOptions.md)
|
|
92
|
-
- [FormElementTypes](type-aliases/FormElementTypes.md)
|
|
93
|
-
- [FormInputElementProps](type-aliases/FormInputElementProps.md)
|
|
94
|
-
- [FormItemName](type-aliases/FormItemName.md)
|
|
95
|
-
- [FormItemProps](type-aliases/FormItemProps.md)
|
|
96
|
-
- [FormLabelElementProps](type-aliases/FormLabelElementProps.md)
|
|
97
|
-
- [FormLang](type-aliases/FormLang.md)
|
|
98
|
-
- [FormProps](type-aliases/FormProps.md)
|
|
99
|
-
- [FormRule](type-aliases/FormRule.md)
|
|
100
|
-
- [FormRules](type-aliases/FormRules.md)
|
|
101
|
-
- [InferFormRulesOptions](type-aliases/InferFormRulesOptions.md)
|
|
46
|
+
- [MockHandler](type-aliases/MockHandler.md)
|
|
102
47
|
- [OnError](type-aliases/OnError.md)
|
|
103
48
|
- [OptionalWrapperProps](type-aliases/OptionalWrapperProps.md)
|
|
104
49
|
- [Options](type-aliases/Options.md)
|
|
50
|
+
- [ResponseErrorProps](type-aliases/ResponseErrorProps.md)
|
|
105
51
|
- [ResponseHeaders](type-aliases/ResponseHeaders.md)
|
|
106
|
-
- [
|
|
52
|
+
- [ResponseProps](type-aliases/ResponseProps.md)
|
|
53
|
+
- [StateSetters](type-aliases/StateSetters.md)
|
|
54
|
+
- [StatesWithSetters](type-aliases/StatesWithSetters.md)
|
|
55
|
+
- [UseFaasOptions](type-aliases/UseFaasOptions.md)
|
|
107
56
|
- [UseFaasStreamOptions](type-aliases/UseFaasStreamOptions.md)
|
|
108
57
|
- [UseFaasStreamResult](type-aliases/UseFaasStreamResult.md)
|
|
109
58
|
|
|
110
59
|
## Variables
|
|
111
60
|
|
|
112
61
|
- [FaasDataWrapper](variables/FaasDataWrapper.md)
|
|
113
|
-
- [FormContextProvider](variables/FormContextProvider.md)
|
|
114
|
-
- [FormDefaultElements](variables/FormDefaultElements.md)
|
|
115
|
-
- [FormDefaultLang](variables/FormDefaultLang.md)
|
|
116
|
-
- [FormDefaultRules](variables/FormDefaultRules.md)
|
|
117
|
-
- [useFormContext](variables/useFormContext.md)
|