Skip to content

Commit 986599b

Browse files
authored
Merge pull request #11 from react-gx/dev
Fix problem with strict mode and async actions
2 parents fe51cdf + bc93655 commit 986599b

27 files changed

+215
-144
lines changed

dist/helpers/types.d.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { type GXSignalType } from '../contexts/types.js';
2-
import { type Builder } from '../interfaces/builder.js';
3-
import type IBuilderCase from '../interfaces/builderCase.js';
1+
import { type GXSignalType } from "../contexts/types.js";
2+
import { type Builder } from "../interfaces/builder.js";
3+
import type IBuilderCase from "../interfaces/builderCase.js";
44
/**
55
* Type of the create signal option function
66
*/
@@ -36,6 +36,10 @@ export interface CreateAsyncActionReturnType {
3636
rejected: AsyncActionStatusesType;
3737
handler: CreateAsyncActionProp;
3838
}
39+
export type AsyncActionReturn<T = null> = Promise<{
40+
data: T;
41+
status: AsyncActionStatusesType;
42+
}>;
3943
export declare const AsyncActionStatuses: {
4044
readonly PENDING: "PENDING";
4145
readonly FULFILLED: "FULFILLED";

dist/helpers/types.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/helpers/types.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hooks/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { type AsyncActionStatusesType } from '../helpers/types';
22
export type Actions = Record<string, (payload?: any) => void>;
33
export type AsyncActions<T> = Record<string, (payload?: any) => Promise<{
44
data: T;
5-
status: Omit<AsyncActionStatusesType, 'PENDING'>;
5+
status: AsyncActionStatusesType;
66
}>>;
77
export type Operations<P = any> = Record<string, (payload?: any) => P>;

dist/hooks/useAllSignals.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default function useAllSignals(): import("../contexts/types").GXSignalType<any>[];

dist/hooks/useAllSignals.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hooks/useAllSignals.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hooks/useAsyncActions.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
import { type AsyncActions } from "./types";
2-
declare const useAsyncActions: <T, P = AsyncActions<T>>(signalName: string, ...actions: string[]) => P;
2+
declare const useAsyncActions: <T, P = AsyncActions<any>>(signalName: string, ...actions: string[]) => P;
33
export default useAsyncActions;

dist/hooks/useAsyncActions.js

Lines changed: 32 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/hooks/useAsyncActions.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)