@betterinternship/components 1.4.1 → 1.4.2
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.
|
@@ -22,7 +22,10 @@ export declare function useClientProcess<T, R>({ caller, loadingMessage, success
|
|
|
22
22
|
successMessage?: string;
|
|
23
23
|
failureMessage?: string;
|
|
24
24
|
}): {
|
|
25
|
-
run: (inputs: T) => Promise<
|
|
25
|
+
run: (inputs: T) => Promise<{
|
|
26
|
+
success: boolean;
|
|
27
|
+
message: string | undefined;
|
|
28
|
+
}>;
|
|
26
29
|
attempts: number;
|
|
27
30
|
status: ProcessStatus;
|
|
28
31
|
result: unknown;
|
package/dist/index.esm.js
CHANGED
|
@@ -3734,9 +3734,16 @@ function useClientProcess({ caller, loadingMessage, successMessage, failureMessa
|
|
|
3734
3734
|
});
|
|
3735
3735
|
}
|
|
3736
3736
|
}, [response, clientProcess]);
|
|
3737
|
+
// Note that the exposed function doesn't return process ids
|
|
3738
|
+
// Client should be oblivious to those
|
|
3739
|
+
// Abstraction BABY!
|
|
3737
3740
|
const wrappedCaller = async (inputs) => {
|
|
3738
3741
|
const response = await caller(inputs);
|
|
3739
3742
|
setResponse(response);
|
|
3743
|
+
return {
|
|
3744
|
+
success: response.success,
|
|
3745
|
+
message: response.message,
|
|
3746
|
+
};
|
|
3740
3747
|
};
|
|
3741
3748
|
return {
|
|
3742
3749
|
run: wrappedCaller,
|