server-act 1.5.3 → 1.6.0
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 +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -111,7 +111,7 @@ export const sayHelloAction = serverAct
|
|
|
111
111
|
),
|
|
112
112
|
}),
|
|
113
113
|
)
|
|
114
|
-
.
|
|
114
|
+
.stateAction(async ({ formData, input, formErrors, ctx }) => {
|
|
115
115
|
if (formErrors) {
|
|
116
116
|
return { formData, formErrors: formErrors.fieldErrors };
|
|
117
117
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -47,7 +47,7 @@ interface ActionBuilder<TParams extends ActionParams> {
|
|
|
47
47
|
/**
|
|
48
48
|
* Create an action for React `useActionState`
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
stateAction: <TState, TPrevState = UnsetMarker>(action: (params: Prettify<{
|
|
51
51
|
ctx: InferContextType<TParams["_context"]>;
|
|
52
52
|
prevState: RemoveUnsetMarker<TPrevState>;
|
|
53
53
|
formData: FormData;
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ interface ActionBuilder<TParams extends ActionParams> {
|
|
|
47
47
|
/**
|
|
48
48
|
* Create an action for React `useActionState`
|
|
49
49
|
*/
|
|
50
|
-
|
|
50
|
+
stateAction: <TState, TPrevState = UnsetMarker>(action: (params: Prettify<{
|
|
51
51
|
ctx: InferContextType<TParams["_context"]>;
|
|
52
52
|
prevState: RemoveUnsetMarker<TPrevState>;
|
|
53
53
|
formData: FormData;
|
package/dist/index.js
CHANGED
package/dist/index.mjs
CHANGED