@faasjs/react 3.0.0-canary.1 → 3.0.0-canary.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 +23 -26
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -11,8 +11,19 @@ React plugin for FaasJS.
|
|
|
11
11
|
|
|
12
12
|
- Support [FaasJS Request Specifications](https://faasjs.com/guide/request-spec.html).
|
|
13
13
|
- Support global and per-request configurations.
|
|
14
|
-
-
|
|
15
|
-
-
|
|
14
|
+
- Support [React Server Actions](https://react.dev/reference/rsc/server-actions).
|
|
15
|
+
- Compatible with [why-did-you-render](https://github.com/welldone-software/why-did-you-render).
|
|
16
|
+
- Additional React functions:
|
|
17
|
+
- Utils:
|
|
18
|
+
- [useConstant](functions/useConstant.md): Create a constant value with hooks.
|
|
19
|
+
- [createSplittingContext](functions/createSplittingContext.md): Create a context for code splitting.
|
|
20
|
+
- [OptionalWrapper](functions/OptionalWrapper.md): Render a component optionally.
|
|
21
|
+
- [ErrorBoundary](classes/ErrorBoundary.md): Catch errors in the component tree.
|
|
22
|
+
- Fetch Data:
|
|
23
|
+
- [faas](functions/faas.md): Fetch data from FaasJS.
|
|
24
|
+
- [useFaas](functions/useFaas.md): Fetch data from FaasJS with hooks.
|
|
25
|
+
- [FaasDataWrapper](functions/FaasDataWrapper.md): Fetch data from FaasJS with a wrapper component.
|
|
26
|
+
- [withFaasData](functions/withFaasData.md): Fetch data from FaasJS using a higher-order component (HOC).
|
|
16
27
|
|
|
17
28
|
## Install
|
|
18
29
|
|
|
@@ -20,19 +31,17 @@ React plugin for FaasJS.
|
|
|
20
31
|
npm install @faasjs/react
|
|
21
32
|
```
|
|
22
33
|
|
|
23
|
-
##
|
|
24
|
-
|
|
25
|
-
1. Initialize [FaasReactClient](#faasreactclient)
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
import { FaasReactClient } from '@faasjs/react'
|
|
29
|
-
|
|
30
|
-
const client = FaasReactClient({
|
|
31
|
-
baseUrl: 'localhost:8080/api/'
|
|
32
|
-
})
|
|
33
|
-
```
|
|
34
|
+
## Functions
|
|
34
35
|
|
|
35
|
-
|
|
36
|
+
- [createSplittingContext](functions/createSplittingContext.md)
|
|
37
|
+
- [faas](functions/faas.md)
|
|
38
|
+
- [FaasDataWrapper](functions/FaasDataWrapper.md)
|
|
39
|
+
- [FaasReactClient](functions/FaasReactClient.md)
|
|
40
|
+
- [getClient](functions/getClient.md)
|
|
41
|
+
- [OptionalWrapper](functions/OptionalWrapper.md)
|
|
42
|
+
- [useConstant](functions/useConstant.md)
|
|
43
|
+
- [useFaas](functions/useFaas.md)
|
|
44
|
+
- [withFaasData](functions/withFaasData.md)
|
|
36
45
|
|
|
37
46
|
## Classes
|
|
38
47
|
|
|
@@ -59,15 +68,3 @@ const client = FaasReactClient({
|
|
|
59
68
|
- [Options](type-aliases/Options.md)
|
|
60
69
|
- [ResponseHeaders](type-aliases/ResponseHeaders.md)
|
|
61
70
|
- [useFaasOptions](type-aliases/useFaasOptions.md)
|
|
62
|
-
|
|
63
|
-
## Functions
|
|
64
|
-
|
|
65
|
-
- [createSplittingContext](functions/createSplittingContext.md)
|
|
66
|
-
- [faas](functions/faas.md)
|
|
67
|
-
- [FaasDataWrapper](functions/FaasDataWrapper.md)
|
|
68
|
-
- [FaasReactClient](functions/FaasReactClient.md)
|
|
69
|
-
- [getClient](functions/getClient.md)
|
|
70
|
-
- [OptionalWrapper](functions/OptionalWrapper.md)
|
|
71
|
-
- [useConstant](functions/useConstant.md)
|
|
72
|
-
- [useFaas](functions/useFaas.md)
|
|
73
|
-
- [withFaasData](functions/withFaasData.md)
|
package/dist/index.d.mts
CHANGED
|
@@ -111,7 +111,7 @@ type FaasDataWrapperProps<PathOrData extends FaasAction> = {
|
|
|
111
111
|
): JSX.Element | JSX.Element[]
|
|
112
112
|
children?: React.ReactElement<Partial<FaasDataInjection>>
|
|
113
113
|
fallback?: JSX.Element | false
|
|
114
|
-
action: string
|
|
114
|
+
action: PathOrData | string
|
|
115
115
|
params?: FaasParams<PathOrData>
|
|
116
116
|
onDataChange?(args: FaasDataInjection<FaasData<PathOrData>>): void
|
|
117
117
|
/** use custom data, should work with setData */
|
package/dist/index.d.ts
CHANGED
|
@@ -111,7 +111,7 @@ type FaasDataWrapperProps<PathOrData extends FaasAction> = {
|
|
|
111
111
|
): JSX.Element | JSX.Element[]
|
|
112
112
|
children?: React.ReactElement<Partial<FaasDataInjection>>
|
|
113
113
|
fallback?: JSX.Element | false
|
|
114
|
-
action: string
|
|
114
|
+
action: PathOrData | string
|
|
115
115
|
params?: FaasParams<PathOrData>
|
|
116
116
|
onDataChange?(args: FaasDataInjection<FaasData<PathOrData>>): void
|
|
117
117
|
/** use custom data, should work with setData */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faasjs/react",
|
|
3
|
-
"version": "3.0.0-canary.
|
|
3
|
+
"version": "3.0.0-canary.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@faasjs/browser": "3.0.0-canary.
|
|
37
|
+
"@faasjs/browser": "3.0.0-canary.3"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
40
|
"react": "*"
|