@data-client/core 0.15.7 → 0.16.7
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/CHANGELOG.md +55 -0
- package/dist/index.js +21 -4
- package/dist/index.umd.min.js +1 -1
- package/dist/mock.js +18 -4
- package/legacy/manager/DevtoolsManager.js +18 -4
- package/legacy/state/GCPolicy.js +4 -1
- package/legacy/state/reducer/setReducer.js +1 -1
- package/legacy/state/reducer/setResponseReducer.js +1 -1
- package/lib/manager/DevtoolsManager.d.ts +1 -0
- package/lib/manager/DevtoolsManager.d.ts.map +1 -1
- package/lib/manager/DevtoolsManager.js +19 -5
- package/lib/state/GCPolicy.d.ts.map +1 -1
- package/lib/state/GCPolicy.js +4 -1
- package/lib/state/reducer/expireReducer.d.ts +2 -2
- package/lib/state/reducer/invalidateReducer.d.ts +2 -2
- package/lib/state/reducer/setReducer.d.ts +1 -27
- package/lib/state/reducer/setReducer.d.ts.map +1 -1
- package/lib/state/reducer/setReducer.js +1 -1
- package/lib/state/reducer/setResponseReducer.d.ts +1 -30
- package/lib/state/reducer/setResponseReducer.d.ts.map +1 -1
- package/lib/state/reducer/setResponseReducer.js +1 -1
- package/package.json +3 -3
- package/src/manager/DevtoolsManager.ts +21 -6
- package/src/state/GCPolicy.ts +3 -0
- package/src/state/__tests__/GCPolicy.test.ts +2 -0
- package/src/state/reducer/setReducer.ts +1 -1
- package/src/state/reducer/setResponseReducer.ts +1 -1
- package/ts3.4/manager/DevtoolsManager.d.ts +1 -0
- package/ts3.4/state/reducer/expireReducer.d.ts +2 -2
- package/ts3.4/state/reducer/invalidateReducer.d.ts +2 -2
- package/ts3.4/state/reducer/setReducer.d.ts +1 -27
- package/ts3.4/state/reducer/setResponseReducer.d.ts +1 -30
|
@@ -7,7 +7,7 @@ export function setReducer(
|
|
|
7
7
|
state: State<unknown>,
|
|
8
8
|
action: SetAction,
|
|
9
9
|
controller: Controller,
|
|
10
|
-
) {
|
|
10
|
+
): State<unknown> {
|
|
11
11
|
let value: any;
|
|
12
12
|
if (typeof action.value === 'function') {
|
|
13
13
|
const previousValue = controller.get(action.schema, ...action.args, state);
|
|
@@ -19,6 +19,7 @@ export default class DevToolsManager implements Manager {
|
|
|
19
19
|
][];
|
|
20
20
|
protected controller: Controller;
|
|
21
21
|
skipLogging?: (action: ActionTypes) => boolean;
|
|
22
|
+
devtoolsName: string;
|
|
22
23
|
maxBufferLength: number;
|
|
23
24
|
constructor(config?: DevToolsConfig, skipLogging?: (action: ActionTypes) => boolean);
|
|
24
25
|
handleAction(action: any, state: any): void;
|
|
@@ -6,7 +6,7 @@ export declare function expireReducer(state: State<unknown>, action: ExpireAllAc
|
|
|
6
6
|
readonly fetchedAt: number;
|
|
7
7
|
readonly expiresAt: number;
|
|
8
8
|
readonly prevExpiresAt?: number;
|
|
9
|
-
readonly error?: import("
|
|
9
|
+
readonly error?: import("@data-client/normalizr").ErrorTypes;
|
|
10
10
|
readonly invalidated?: boolean;
|
|
11
11
|
readonly errorPolicy?: "hard" | "soft" | undefined;
|
|
12
12
|
};
|
|
@@ -19,7 +19,7 @@ export declare function expireReducer(state: State<unknown>, action: ExpireAllAc
|
|
|
19
19
|
endpoints: {
|
|
20
20
|
readonly [key: string]: unknown | import("../../types.js").PK[] | import("../../types.js").PK | undefined;
|
|
21
21
|
};
|
|
22
|
-
indexes: import("
|
|
22
|
+
indexes: import("@data-client/normalizr").NormalizedIndex;
|
|
23
23
|
entitiesMeta: {
|
|
24
24
|
readonly [entityKey: string]: {
|
|
25
25
|
readonly [pk: string]: {
|
|
@@ -9,7 +9,7 @@ export declare function invalidateReducer(state: State<unknown>, action: Invalid
|
|
|
9
9
|
readonly fetchedAt: number;
|
|
10
10
|
readonly expiresAt: number;
|
|
11
11
|
readonly prevExpiresAt?: number;
|
|
12
|
-
readonly error?: import("
|
|
12
|
+
readonly error?: import("@data-client/normalizr").ErrorTypes;
|
|
13
13
|
readonly invalidated?: boolean;
|
|
14
14
|
readonly errorPolicy?: "hard" | "soft" | undefined;
|
|
15
15
|
};
|
|
@@ -19,7 +19,7 @@ export declare function invalidateReducer(state: State<unknown>, action: Invalid
|
|
|
19
19
|
readonly [pk: string]: unknown;
|
|
20
20
|
} | undefined;
|
|
21
21
|
};
|
|
22
|
-
indexes: import("
|
|
22
|
+
indexes: import("@data-client/normalizr").NormalizedIndex;
|
|
23
23
|
entitiesMeta: {
|
|
24
24
|
readonly [entityKey: string]: {
|
|
25
25
|
readonly [pk: string]: {
|
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
import Controller from '../../controller/Controller.js';
|
|
2
2
|
import { State, SetAction } from '../../types.js';
|
|
3
|
-
export declare function setReducer(state: State<unknown>, action: SetAction, controller: Controller): State<unknown
|
|
4
|
-
entities: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
};
|
|
7
|
-
endpoints: {
|
|
8
|
-
readonly [key: string]: unknown;
|
|
9
|
-
};
|
|
10
|
-
indexes: import("@data-client/normalizr").NormalizedIndex;
|
|
11
|
-
meta: {
|
|
12
|
-
readonly [key: string]: {
|
|
13
|
-
readonly date: number;
|
|
14
|
-
readonly fetchedAt: number;
|
|
15
|
-
readonly expiresAt: number;
|
|
16
|
-
readonly prevExpiresAt?: number;
|
|
17
|
-
readonly error?: import("@data-client/normalizr").ErrorTypes;
|
|
18
|
-
readonly invalidated?: boolean;
|
|
19
|
-
readonly errorPolicy?: "hard" | "soft" | undefined;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
entitiesMeta: import("packages/normalizr/lib/types.js").EntitiesToMeta<{
|
|
23
|
-
[x: string]: any;
|
|
24
|
-
}>;
|
|
25
|
-
optimistic: (import("../../actions.js").OptimisticAction<import("@data-client/normalizr").EndpointInterface<import("@data-client/normalizr").FetchFunction, import("@data-client/normalizr").Schema | undefined, boolean | undefined> & {
|
|
26
|
-
update?: import("../../index.js").EndpointUpdateFunction<import("@data-client/normalizr").EndpointInterface>;
|
|
27
|
-
}> | import("../../actions.js").SetResponseAction)[];
|
|
28
|
-
lastReset: number;
|
|
29
|
-
};
|
|
3
|
+
export declare function setReducer(state: State<unknown>, action: SetAction, controller: Controller): State<unknown>;
|
|
30
4
|
//# sourceMappingURL=setReducer.d.ts.map
|
|
@@ -1,33 +1,4 @@
|
|
|
1
1
|
import Controller from '../../controller/Controller.js';
|
|
2
2
|
import { State, SetResponseAction, OptimisticAction } from '../../types.js';
|
|
3
|
-
export declare function setResponseReducer(state: State<unknown>, action: OptimisticAction | SetResponseAction, controller: Controller): State<unknown
|
|
4
|
-
entities: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
};
|
|
7
|
-
endpoints: Record<string, unknown>;
|
|
8
|
-
indexes: import("@data-client/normalizr").NormalizedIndex;
|
|
9
|
-
meta: {
|
|
10
|
-
[x: string]: {
|
|
11
|
-
readonly date: number;
|
|
12
|
-
readonly fetchedAt: number;
|
|
13
|
-
readonly expiresAt: number;
|
|
14
|
-
readonly prevExpiresAt?: number;
|
|
15
|
-
readonly error?: import("@data-client/normalizr").ErrorTypes;
|
|
16
|
-
readonly invalidated?: boolean;
|
|
17
|
-
readonly errorPolicy?: "hard" | "soft" | undefined;
|
|
18
|
-
} | {
|
|
19
|
-
date: number;
|
|
20
|
-
fetchedAt: number;
|
|
21
|
-
expiresAt: number;
|
|
22
|
-
prevExpiresAt: number;
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
entitiesMeta: import("packages/normalizr/lib/types.js").EntitiesToMeta<{
|
|
26
|
-
[x: string]: any;
|
|
27
|
-
}>;
|
|
28
|
-
optimistic: (OptimisticAction<import("@data-client/normalizr").EndpointInterface<import("@data-client/normalizr").FetchFunction, import("@data-client/normalizr").Schema | undefined, boolean | undefined> & {
|
|
29
|
-
update?: import("../../index.js").EndpointUpdateFunction<import("@data-client/normalizr").EndpointInterface>;
|
|
30
|
-
}> | SetResponseAction)[];
|
|
31
|
-
lastReset: number;
|
|
32
|
-
};
|
|
3
|
+
export declare function setResponseReducer(state: State<unknown>, action: OptimisticAction | SetResponseAction, controller: Controller): State<unknown>;
|
|
33
4
|
//# sourceMappingURL=setResponseReducer.d.ts.map
|