@faasjs/react 8.0.0-beta.2 → 8.0.0-beta.20
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 +16 -68
- package/dist/index.d.ts +1571 -410
- package/dist/index.mjs +1796 -596
- package/package.json +18 -22
- package/dist/index.cjs +0 -652
package/README.md
CHANGED
|
@@ -1,85 +1,45 @@
|
|
|
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
|
-
- [FaasDataWrapper](functions/FaasDataWrapper.md): Fetch data from FaasJS with a wrapper component.
|
|
35
|
-
- [withFaasData](functions/withFaasData.md): Fetch data from FaasJS using a higher-order component (HOC).
|
|
36
|
-
|
|
37
|
-
## Install
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
npm install @faasjs/react react
|
|
41
|
-
```
|
|
42
|
-
|
|
43
3
|
## Functions
|
|
44
4
|
|
|
45
5
|
- [createSplittingContext](functions/createSplittingContext.md)
|
|
46
6
|
- [equal](functions/equal.md)
|
|
47
7
|
- [faas](functions/faas.md)
|
|
48
8
|
- [FaasReactClient](functions/FaasReactClient.md)
|
|
49
|
-
- [
|
|
50
|
-
- [FormItem](functions/FormItem.md)
|
|
9
|
+
- [generateId](functions/generateId.md)
|
|
51
10
|
- [getClient](functions/getClient.md)
|
|
11
|
+
- [OptionalWrapper](functions/OptionalWrapper.md)
|
|
12
|
+
- [setMock](functions/setMock.md)
|
|
52
13
|
- [useConstant](functions/useConstant.md)
|
|
53
14
|
- [useEqualCallback](functions/useEqualCallback.md)
|
|
54
15
|
- [useEqualEffect](functions/useEqualEffect.md)
|
|
55
16
|
- [useEqualMemo](functions/useEqualMemo.md)
|
|
56
17
|
- [useEqualMemoize](functions/useEqualMemoize.md)
|
|
57
18
|
- [useFaas](functions/useFaas.md)
|
|
19
|
+
- [useFaasStream](functions/useFaasStream.md)
|
|
58
20
|
- [usePrevious](functions/usePrevious.md)
|
|
59
21
|
- [useSplittingState](functions/useSplittingState.md)
|
|
60
22
|
- [useStateRef](functions/useStateRef.md)
|
|
61
|
-
- [validValues](functions/validValues.md)
|
|
62
23
|
- [withFaasData](functions/withFaasData.md)
|
|
63
24
|
|
|
64
25
|
## Classes
|
|
65
26
|
|
|
66
27
|
- [ErrorBoundary](classes/ErrorBoundary.md)
|
|
28
|
+
- [FaasBrowserClient](classes/FaasBrowserClient.md)
|
|
29
|
+
- [Response](classes/Response.md)
|
|
30
|
+
- [ResponseError](classes/ResponseError.md)
|
|
67
31
|
|
|
68
32
|
## Interfaces
|
|
69
33
|
|
|
70
34
|
- [ErrorBoundaryProps](interfaces/ErrorBoundaryProps.md)
|
|
71
|
-
- [Response](interfaces/Response.md)
|
|
72
|
-
- [ResponseError](interfaces/ResponseError.md)
|
|
73
|
-
|
|
74
|
-
## Namespaces
|
|
75
|
-
|
|
76
|
-
- [OptionalWrapper](@faasjs/namespaces/OptionalWrapper/README.md)
|
|
77
35
|
|
|
78
36
|
## Type Aliases
|
|
79
37
|
|
|
38
|
+
- [BaseUrl](type-aliases/BaseUrl.md)
|
|
80
39
|
- [ErrorChildrenProps](type-aliases/ErrorChildrenProps.md)
|
|
81
40
|
- [FaasAction](type-aliases/FaasAction.md)
|
|
82
41
|
- [FaasActionUnionType](type-aliases/FaasActionUnionType.md)
|
|
42
|
+
- [FaasBrowserClientAction](type-aliases/FaasBrowserClientAction.md)
|
|
83
43
|
- [FaasData](type-aliases/FaasData.md)
|
|
84
44
|
- [FaasDataInjection](type-aliases/FaasDataInjection.md)
|
|
85
45
|
- [FaasDataWrapperProps](type-aliases/FaasDataWrapperProps.md)
|
|
@@ -87,31 +47,19 @@ npm install @faasjs/react react
|
|
|
87
47
|
- [FaasParams](type-aliases/FaasParams.md)
|
|
88
48
|
- [FaasReactClientInstance](type-aliases/FaasReactClientInstance.md)
|
|
89
49
|
- [FaasReactClientOptions](type-aliases/FaasReactClientOptions.md)
|
|
90
|
-
- [
|
|
91
|
-
- [FormContextProps](type-aliases/FormContextProps.md)
|
|
92
|
-
- [FormDefaultRulesOptions](type-aliases/FormDefaultRulesOptions.md)
|
|
93
|
-
- [FormElementTypes](type-aliases/FormElementTypes.md)
|
|
94
|
-
- [FormInputElementProps](type-aliases/FormInputElementProps.md)
|
|
95
|
-
- [FormItemName](type-aliases/FormItemName.md)
|
|
96
|
-
- [FormItemProps](type-aliases/FormItemProps.md)
|
|
97
|
-
- [FormLabelElementProps](type-aliases/FormLabelElementProps.md)
|
|
98
|
-
- [FormLang](type-aliases/FormLang.md)
|
|
99
|
-
- [FormProps](type-aliases/FormProps.md)
|
|
100
|
-
- [FormRule](type-aliases/FormRule.md)
|
|
101
|
-
- [FormRules](type-aliases/FormRules.md)
|
|
102
|
-
- [InferFormRulesOptions](type-aliases/InferFormRulesOptions.md)
|
|
50
|
+
- [MockHandler](type-aliases/MockHandler.md)
|
|
103
51
|
- [OnError](type-aliases/OnError.md)
|
|
104
52
|
- [OptionalWrapperProps](type-aliases/OptionalWrapperProps.md)
|
|
105
53
|
- [Options](type-aliases/Options.md)
|
|
54
|
+
- [ResponseErrorProps](type-aliases/ResponseErrorProps.md)
|
|
106
55
|
- [ResponseHeaders](type-aliases/ResponseHeaders.md)
|
|
56
|
+
- [ResponseProps](type-aliases/ResponseProps.md)
|
|
57
|
+
- [StateSetters](type-aliases/StateSetters.md)
|
|
58
|
+
- [StatesWithSetters](type-aliases/StatesWithSetters.md)
|
|
107
59
|
- [useFaasOptions](type-aliases/useFaasOptions.md)
|
|
60
|
+
- [UseFaasStreamOptions](type-aliases/UseFaasStreamOptions.md)
|
|
61
|
+
- [UseFaasStreamResult](type-aliases/UseFaasStreamResult.md)
|
|
108
62
|
|
|
109
63
|
## Variables
|
|
110
64
|
|
|
111
65
|
- [FaasDataWrapper](variables/FaasDataWrapper.md)
|
|
112
|
-
- [FormContextProvider](variables/FormContextProvider.md)
|
|
113
|
-
- [FormDefaultElements](variables/FormDefaultElements.md)
|
|
114
|
-
- [FormDefaultLang](variables/FormDefaultLang.md)
|
|
115
|
-
- [FormDefaultRules](variables/FormDefaultRules.md)
|
|
116
|
-
- [OptionalWrapper](variables/OptionalWrapper.md)
|
|
117
|
-
- [useFormContext](variables/useFormContext.md)
|