File tree Expand file tree Collapse file tree 6 files changed +17
-7
lines changed
website/src/components/Playground/editor-types/@data-client Expand file tree Collapse file tree 6 files changed +17
-7
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @data-client/core ' : patch
3
+ ' @data-client/react ' : patch
4
+ ---
5
+
6
+ state.endpoints moved above indexes
7
+
8
+ ` entites ` and ` endpoints ` are the most commonly inspected
9
+ parts of state when debugging, so it is better to have endpoints
10
+ above indexes.
Original file line number Diff line number Diff line change @@ -66,8 +66,8 @@ export default function createReducer(controller: Controller): ReducerType {
66
66
67
67
export const initialState : State < unknown > = {
68
68
entities : { } ,
69
- indexes : { } ,
70
69
endpoints : { } ,
70
+ indexes : { } ,
71
71
meta : { } ,
72
72
entityMeta : { } ,
73
73
optimistic : [ ] ,
Original file line number Diff line number Diff line change @@ -26,10 +26,10 @@ export function setReducer(
26
26
) ;
27
27
return {
28
28
entities,
29
- indexes,
30
29
endpoints : state . endpoints ,
31
- entityMeta ,
30
+ indexes ,
32
31
meta : state . meta ,
32
+ entityMeta,
33
33
optimistic : state . optimistic ,
34
34
lastReset : state . lastReset ,
35
35
} ;
Original file line number Diff line number Diff line change @@ -69,9 +69,8 @@ export function setResponseReducer(
69
69
}
70
70
return {
71
71
entities,
72
- indexes,
73
72
endpoints,
74
- entityMeta ,
73
+ indexes ,
75
74
meta : {
76
75
...state . meta ,
77
76
[ action . key ] : {
@@ -80,6 +79,7 @@ export function setResponseReducer(
80
79
prevExpiresAt : state . meta [ action . key ] ?. expiresAt ,
81
80
} ,
82
81
} ,
82
+ entityMeta,
83
83
optimistic : filterOptimistic ( state , action ) ,
84
84
lastReset : state . lastReset ,
85
85
} ;
Original file line number Diff line number Diff line change @@ -22,10 +22,10 @@ export interface State<T> {
22
22
readonly entities : {
23
23
readonly [ entityKey : string ] : { readonly [ pk : string ] : T } | undefined ;
24
24
} ;
25
- readonly indexes : NormalizedIndex ;
26
25
readonly endpoints : {
27
26
readonly [ key : string ] : unknown | PK [ ] | PK | undefined ;
28
27
} ;
28
+ readonly indexes : NormalizedIndex ;
29
29
readonly meta : {
30
30
readonly [ key : string ] : {
31
31
readonly date : number ;
Original file line number Diff line number Diff line change @@ -393,10 +393,10 @@ interface State<T> {
393
393
readonly [ pk : string ] : T ;
394
394
} | undefined ;
395
395
} ;
396
- readonly indexes : NormalizedIndex ;
397
396
readonly endpoints : {
398
397
readonly [ key : string ] : unknown | PK [ ] | PK | undefined ;
399
398
} ;
399
+ readonly indexes : NormalizedIndex ;
400
400
readonly meta : {
401
401
readonly [ key : string ] : {
402
402
readonly date : number ;
You can’t perform that action at this time.
0 commit comments