@weser/actions 0.0.14 → 0.0.16
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 +3 -0
- package/dist/useAction.d.ts +2 -2
- package/dist/useAction.js +1 -1
- package/package.json +2 -2
package/README.md
ADDED
package/dist/useAction.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { T_ActionResponse } from './types.js';
|
|
2
2
|
type State<T> = {
|
|
3
3
|
loading: boolean;
|
|
4
|
-
data
|
|
4
|
+
data: T | null;
|
|
5
5
|
error: string | null;
|
|
6
6
|
};
|
|
7
7
|
type T_ActionConfig<T> = {
|
|
8
|
-
onSuccess?: (data
|
|
8
|
+
onSuccess?: (data: T) => void;
|
|
9
9
|
onError?: (error: string) => void;
|
|
10
10
|
};
|
|
11
11
|
export default function useAction<T, P extends Array<any>>(action: (...payload: P) => Promise<T_ActionResponse<T>>, config?: T_ActionConfig<T>): [State<T>, (...payload: P) => void];
|
package/dist/useAction.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weser/actions",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "React helpers for working with server actions",
|
|
5
5
|
"author": "Robin Weser <robin@weser.io>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"rimraf": "^3.0.2",
|
|
53
53
|
"typescript": "^5.4.5"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "7b2bc4fa318330eb2031b0d1835554a8a9f0f6bd"
|
|
56
56
|
}
|