monorise 2.0.0-dev.1 → 2.0.0-dev.3
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/dist/base/index.d.ts +126 -1
- package/dist/base/index.js +168 -1
- package/dist/base/index.js.map +1 -1
- package/dist/cli/cli.js +226 -123
- package/dist/cli/cli.js.map +1 -1
- package/dist/core/index.d.ts +110 -21
- package/dist/core/index.js +601 -82
- package/dist/core/index.js.map +1 -1
- package/dist/index.d.ts +19 -0
- package/dist/react/actions/core.action.d.ts +24 -70
- package/dist/react/actions/core.action.d.ts.map +1 -1
- package/dist/react/actions/websocket.action.d.ts.map +1 -1
- package/dist/react/index.d.ts +47 -138
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +141 -40
- package/dist/react/index.js.map +1 -1
- package/dist/react/lib/search.d.ts +29 -0
- package/dist/react/lib/search.d.ts.map +1 -0
- package/dist/react/services/core.service.d.ts.map +1 -1
- package/dist/react/types/api.type.d.ts +12 -0
- package/dist/react/types/api.type.d.ts.map +1 -1
- package/dist/react/types/monorise.type.d.ts +1 -0
- package/dist/react/types/monorise.type.d.ts.map +1 -1
- package/dist/sst/components/monorise-core.d.ts +1 -0
- package/dist/sst/components/monorise-core.d.ts.map +1 -1
- package/dist/sst/index.js +66 -1
- package/dist/sst/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -408,8 +408,56 @@ var byEntityId = (a, b) => {
|
|
|
408
408
|
return 1;
|
|
409
409
|
};
|
|
410
410
|
|
|
411
|
+
// lib/search.ts
|
|
412
|
+
var MARKS = new RegExp("\\p{M}", "gu");
|
|
413
|
+
var LOOKUP_WORD = /[\p{L}\p{N}]{2,}/u;
|
|
414
|
+
var canSearch = (state, entityType, query) => {
|
|
415
|
+
var _a;
|
|
416
|
+
if (!query.trim()) return false;
|
|
417
|
+
if (!((_a = state.config[entityType]) == null ? void 0 : _a.search)) return true;
|
|
418
|
+
return LOOKUP_WORD.test(query.normalize("NFKD").replace(MARKS, ""));
|
|
419
|
+
};
|
|
420
|
+
var isNewer = (a, b) => new Date(a.updatedAt).getTime() > new Date(b.updatedAt).getTime();
|
|
421
|
+
var applySearchResults = (state, entityType, query, results) => {
|
|
422
|
+
const slice = state.entity[entityType];
|
|
423
|
+
if (!slice) return;
|
|
424
|
+
slice.searchResults = results.map((result) => {
|
|
425
|
+
const cached = slice.dataMap.get(result.entityId);
|
|
426
|
+
if (cached && isNewer(cached, result)) return cached;
|
|
427
|
+
slice.dataMap.set(result.entityId, result);
|
|
428
|
+
return result;
|
|
429
|
+
});
|
|
430
|
+
slice.searchQuery = query;
|
|
431
|
+
};
|
|
432
|
+
var updateSearchResult = (state, entityType, entity) => {
|
|
433
|
+
var _a;
|
|
434
|
+
const results = (_a = state.entity[entityType]) == null ? void 0 : _a.searchResults;
|
|
435
|
+
if (!results) return;
|
|
436
|
+
const index = results.findIndex((e) => e.entityId === entity.entityId);
|
|
437
|
+
if (index >= 0) results[index] = entity;
|
|
438
|
+
};
|
|
439
|
+
var removeFromSearchResults = (state, entityType, entityId) => {
|
|
440
|
+
const slice = state.entity[entityType];
|
|
441
|
+
if (!(slice == null ? void 0 : slice.searchResults)) return;
|
|
442
|
+
slice.searchResults = slice.searchResults.filter(
|
|
443
|
+
(e) => e.entityId !== entityId
|
|
444
|
+
);
|
|
445
|
+
};
|
|
446
|
+
|
|
411
447
|
// actions/core.action.ts
|
|
412
448
|
var EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
449
|
+
var toRequestError = (err) => {
|
|
450
|
+
var _a;
|
|
451
|
+
const error = err instanceof Error ? err : new Error("Unknown error occurred");
|
|
452
|
+
const response = err == null ? void 0 : err.response;
|
|
453
|
+
if (response) {
|
|
454
|
+
if (typeof response.status === "number") error.status = response.status;
|
|
455
|
+
error.data = response.data;
|
|
456
|
+
const code = (_a = response.data) == null ? void 0 : _a.code;
|
|
457
|
+
if (typeof code === "string") error.code = code;
|
|
458
|
+
}
|
|
459
|
+
return error;
|
|
460
|
+
};
|
|
413
461
|
var defaultOnError = (error) => {
|
|
414
462
|
if (!(error instanceof Error) && error.status >= 500) {
|
|
415
463
|
throw error;
|
|
@@ -417,6 +465,7 @@ var defaultOnError = (error) => {
|
|
|
417
465
|
};
|
|
418
466
|
var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
419
467
|
const { makeEntityService, makeMutualService } = coreService2;
|
|
468
|
+
const latestSearchQueries = /* @__PURE__ */ new Map();
|
|
420
469
|
const {
|
|
421
470
|
checkIsLoading,
|
|
422
471
|
getError: getError2,
|
|
@@ -473,7 +522,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
473
522
|
`mr/entity/list/${entityType}`
|
|
474
523
|
);
|
|
475
524
|
} catch (err) {
|
|
476
|
-
const error2 = err
|
|
525
|
+
const error2 = toRequestError(err);
|
|
477
526
|
return { error: error2 };
|
|
478
527
|
}
|
|
479
528
|
};
|
|
@@ -516,36 +565,37 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
516
565
|
`mr/entity/list-more/${entityType}`
|
|
517
566
|
);
|
|
518
567
|
} catch (err) {
|
|
519
|
-
const error2 = err
|
|
568
|
+
const error2 = toRequestError(err);
|
|
520
569
|
return { error: error2 };
|
|
521
570
|
}
|
|
522
571
|
};
|
|
523
572
|
const searchEntities = async (entityType, query, opts = {}) => {
|
|
524
|
-
var _a;
|
|
525
|
-
const requestKey = getEntityRequestKey("search", entityType);
|
|
526
573
|
const entityService = makeEntityService(entityType);
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
574
|
+
latestSearchQueries.set(entityType, query);
|
|
575
|
+
if (!canSearch(monoriseStore.getState(), entityType, query)) {
|
|
576
|
+
monoriseStore.setState(
|
|
577
|
+
produce3((state) => {
|
|
578
|
+
applySearchResults(state, entityType, query, []);
|
|
579
|
+
})
|
|
580
|
+
);
|
|
531
581
|
return;
|
|
532
582
|
}
|
|
533
583
|
try {
|
|
534
584
|
const { data: result } = await entityService.searchEntities(query, opts);
|
|
585
|
+
if (latestSearchQueries.get(entityType) !== query) return;
|
|
535
586
|
monoriseStore.setState(
|
|
536
587
|
produce3((state) => {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
}
|
|
588
|
+
applySearchResults(
|
|
589
|
+
state,
|
|
590
|
+
entityType,
|
|
591
|
+
query,
|
|
592
|
+
result.data
|
|
593
|
+
);
|
|
544
594
|
})
|
|
545
595
|
);
|
|
546
596
|
} catch (err) {
|
|
547
|
-
const
|
|
548
|
-
return { error
|
|
597
|
+
const error = toRequestError(err);
|
|
598
|
+
return { error };
|
|
549
599
|
}
|
|
550
600
|
};
|
|
551
601
|
const listEntitiesByTag = async (entityType, tagName, opts = {}) => {
|
|
@@ -608,7 +658,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
608
658
|
);
|
|
609
659
|
return { data };
|
|
610
660
|
} catch (err) {
|
|
611
|
-
const error2 = err
|
|
661
|
+
const error2 = toRequestError(err);
|
|
612
662
|
return { error: error2 };
|
|
613
663
|
}
|
|
614
664
|
};
|
|
@@ -647,7 +697,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
647
697
|
);
|
|
648
698
|
return { data: entity };
|
|
649
699
|
} catch (err) {
|
|
650
|
-
const error2 = err
|
|
700
|
+
const error2 = toRequestError(err);
|
|
651
701
|
return { error: error2 };
|
|
652
702
|
}
|
|
653
703
|
};
|
|
@@ -692,7 +742,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
692
742
|
);
|
|
693
743
|
return { data: entity };
|
|
694
744
|
} catch (err) {
|
|
695
|
-
const error2 = err
|
|
745
|
+
const error2 = toRequestError(err);
|
|
696
746
|
return { error: error2 };
|
|
697
747
|
}
|
|
698
748
|
};
|
|
@@ -790,7 +840,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
790
840
|
);
|
|
791
841
|
return { data };
|
|
792
842
|
} catch (err) {
|
|
793
|
-
const error = err
|
|
843
|
+
const error = toRequestError(err);
|
|
794
844
|
onError == null ? void 0 : onError(error);
|
|
795
845
|
return { error };
|
|
796
846
|
}
|
|
@@ -804,13 +854,18 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
804
854
|
monoriseStore.setState(
|
|
805
855
|
produce3((state) => {
|
|
806
856
|
state.entity[entityType].dataMap.set(data.entityId, data);
|
|
857
|
+
updateSearchResult(
|
|
858
|
+
state,
|
|
859
|
+
entityType,
|
|
860
|
+
data
|
|
861
|
+
);
|
|
807
862
|
}),
|
|
808
863
|
void 0,
|
|
809
864
|
`mr/entity/upsert/${entityType}/${id}`
|
|
810
865
|
);
|
|
811
866
|
return { data };
|
|
812
867
|
} catch (err) {
|
|
813
|
-
const error = err
|
|
868
|
+
const error = toRequestError(err);
|
|
814
869
|
onError(error);
|
|
815
870
|
return { error };
|
|
816
871
|
}
|
|
@@ -887,6 +942,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
887
942
|
const deleteEntityFromStores = (state, entityType, entityId) => {
|
|
888
943
|
var _a, _b, _c;
|
|
889
944
|
(_a = state.entity[entityType]) == null ? void 0 : _a.dataMap.delete(entityId);
|
|
945
|
+
removeFromSearchResults(state, entityType, entityId);
|
|
890
946
|
for (const key of Object.keys(state.mutual)) {
|
|
891
947
|
const { entity: mutualEntityType } = parseMutualStateKey(key);
|
|
892
948
|
if (mutualEntityType === entityType) {
|
|
@@ -916,13 +972,18 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
916
972
|
id,
|
|
917
973
|
data
|
|
918
974
|
);
|
|
975
|
+
updateSearchResult(
|
|
976
|
+
state,
|
|
977
|
+
entityType,
|
|
978
|
+
data
|
|
979
|
+
);
|
|
919
980
|
}),
|
|
920
981
|
void 0,
|
|
921
982
|
`mr/entity/edit/${entityType}/${id}`
|
|
922
983
|
);
|
|
923
984
|
return { data };
|
|
924
985
|
} catch (err) {
|
|
925
|
-
const error = err
|
|
986
|
+
const error = toRequestError(err);
|
|
926
987
|
onError(error);
|
|
927
988
|
return { error };
|
|
928
989
|
}
|
|
@@ -943,6 +1004,11 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
943
1004
|
id,
|
|
944
1005
|
data
|
|
945
1006
|
);
|
|
1007
|
+
updateSearchResult(
|
|
1008
|
+
state,
|
|
1009
|
+
entityType,
|
|
1010
|
+
data
|
|
1011
|
+
);
|
|
946
1012
|
}),
|
|
947
1013
|
void 0,
|
|
948
1014
|
`mr/entity/adjust/${entityType}/${id}`
|
|
@@ -952,7 +1018,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
952
1018
|
if (((_b = err == null ? void 0 : err.response) == null ? void 0 : _b.status) === 409) {
|
|
953
1019
|
await getEntity2(entityType, id, { forceFetch: true });
|
|
954
1020
|
}
|
|
955
|
-
const error = err
|
|
1021
|
+
const error = toRequestError(err);
|
|
956
1022
|
onError(error);
|
|
957
1023
|
return { error };
|
|
958
1024
|
}
|
|
@@ -973,7 +1039,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
973
1039
|
);
|
|
974
1040
|
return { data: { entityId: id } };
|
|
975
1041
|
} catch (err) {
|
|
976
|
-
const error = err
|
|
1042
|
+
const error = toRequestError(err);
|
|
977
1043
|
onError(error);
|
|
978
1044
|
return { error };
|
|
979
1045
|
}
|
|
@@ -1104,6 +1170,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1104
1170
|
state.entity[entityType].dataMap.set(entityId, updated);
|
|
1105
1171
|
propagateEntityDataToMutuals(state, entityType, entityId, updated.data);
|
|
1106
1172
|
reconcileTaggedEntityStore(state, entityType, entityId, updated);
|
|
1173
|
+
updateSearchResult(state, entityType, updated);
|
|
1107
1174
|
});
|
|
1108
1175
|
}),
|
|
1109
1176
|
void 0,
|
|
@@ -1126,7 +1193,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1126
1193
|
clearError2(callRequestKey);
|
|
1127
1194
|
}
|
|
1128
1195
|
}
|
|
1129
|
-
const error = err
|
|
1196
|
+
const error = toRequestError(err);
|
|
1130
1197
|
onError(error);
|
|
1131
1198
|
return { error };
|
|
1132
1199
|
}
|
|
@@ -1208,7 +1275,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1208
1275
|
);
|
|
1209
1276
|
return { data };
|
|
1210
1277
|
} catch (err) {
|
|
1211
|
-
const error2 = err
|
|
1278
|
+
const error2 = toRequestError(err);
|
|
1212
1279
|
return { error: error2 };
|
|
1213
1280
|
}
|
|
1214
1281
|
};
|
|
@@ -1252,7 +1319,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1252
1319
|
));
|
|
1253
1320
|
} catch (err) {
|
|
1254
1321
|
if (!opts.defaultMutualData) {
|
|
1255
|
-
const error2 = err
|
|
1322
|
+
const error2 = toRequestError(err);
|
|
1256
1323
|
return { error: error2 };
|
|
1257
1324
|
}
|
|
1258
1325
|
hasRequestFailed = true;
|
|
@@ -1337,7 +1404,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1337
1404
|
);
|
|
1338
1405
|
return { data: mutual };
|
|
1339
1406
|
} catch (err) {
|
|
1340
|
-
const error = err
|
|
1407
|
+
const error = toRequestError(err);
|
|
1341
1408
|
onError(error);
|
|
1342
1409
|
return { error };
|
|
1343
1410
|
}
|
|
@@ -1384,6 +1451,11 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1384
1451
|
monoriseStore.setState(
|
|
1385
1452
|
produce3((state) => {
|
|
1386
1453
|
state.entity[entityType].dataMap.set(entityId, createdEntity);
|
|
1454
|
+
updateSearchResult(
|
|
1455
|
+
state,
|
|
1456
|
+
entityType,
|
|
1457
|
+
createdEntity
|
|
1458
|
+
);
|
|
1387
1459
|
}),
|
|
1388
1460
|
void 0,
|
|
1389
1461
|
`mr/entity/local-update/${entityType}/${entityId}`
|
|
@@ -1470,7 +1542,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1470
1542
|
);
|
|
1471
1543
|
return { data: mutual };
|
|
1472
1544
|
} catch (err) {
|
|
1473
|
-
const error = err
|
|
1545
|
+
const error = toRequestError(err);
|
|
1474
1546
|
onError(error);
|
|
1475
1547
|
return { error };
|
|
1476
1548
|
}
|
|
@@ -1502,7 +1574,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1502
1574
|
);
|
|
1503
1575
|
return { data };
|
|
1504
1576
|
} catch (err) {
|
|
1505
|
-
const error = err
|
|
1577
|
+
const error = toRequestError(err);
|
|
1506
1578
|
onError(error);
|
|
1507
1579
|
return { error };
|
|
1508
1580
|
}
|
|
@@ -1874,24 +1946,32 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1874
1946
|
listEntities(entityType, { skRange, all, limit }, opts);
|
|
1875
1947
|
}
|
|
1876
1948
|
}, [all, entityType, skRange, opts, isFirstFetched, opts == null ? void 0 : opts.forceFetch, limit]);
|
|
1949
|
+
const searchable = useMemo(
|
|
1950
|
+
() => canSearch(monoriseStore.getState(), entityType, query),
|
|
1951
|
+
[entityType, query]
|
|
1952
|
+
);
|
|
1877
1953
|
useEffect2(() => {
|
|
1878
1954
|
var _a;
|
|
1879
|
-
if (!
|
|
1955
|
+
if (!searchable) {
|
|
1880
1956
|
setIsSearching(false);
|
|
1881
1957
|
return;
|
|
1882
1958
|
}
|
|
1883
1959
|
setIsSearching(true);
|
|
1960
|
+
let superseded = false;
|
|
1884
1961
|
const queryTimeout = setTimeout(async () => {
|
|
1885
1962
|
await searchEntities(entityType, query);
|
|
1886
|
-
setIsSearching(false);
|
|
1963
|
+
if (!superseded) setIsSearching(false);
|
|
1887
1964
|
}, (_a = opts.searchInterval) != null ? _a : 700);
|
|
1888
|
-
return () =>
|
|
1889
|
-
|
|
1965
|
+
return () => {
|
|
1966
|
+
superseded = true;
|
|
1967
|
+
clearTimeout(queryTimeout);
|
|
1968
|
+
};
|
|
1969
|
+
}, [entityType, query, searchable]);
|
|
1890
1970
|
const listed = useMemo(
|
|
1891
1971
|
() => Array.from(dataMap.values()).sort(byEntityId),
|
|
1892
1972
|
[dataMap]
|
|
1893
1973
|
);
|
|
1894
|
-
const entities =
|
|
1974
|
+
const entities = searchable ? searchResults : listed;
|
|
1895
1975
|
const handleQueryChange = (event) => {
|
|
1896
1976
|
setQuery(event.target.value);
|
|
1897
1977
|
};
|
|
@@ -1909,7 +1989,7 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
1909
1989
|
isFirstFetched,
|
|
1910
1990
|
lastKey,
|
|
1911
1991
|
refetch: async () => {
|
|
1912
|
-
if (entityType &&
|
|
1992
|
+
if (entityType && searchable) {
|
|
1913
1993
|
await searchEntities(entityType, query);
|
|
1914
1994
|
return;
|
|
1915
1995
|
}
|
|
@@ -2078,11 +2158,12 @@ var initCoreActions = (monoriseStore, appActions, coreService2) => {
|
|
|
2078
2158
|
const requestKey = getTagRequestKey("list", entityType, tagName, params);
|
|
2079
2159
|
const isLoading = useLoadStore2(requestKey);
|
|
2080
2160
|
const error = useErrorStore2(requestKey);
|
|
2161
|
+
const paramsReady = !!params && Object.keys(params).length > 0 && Object.values(params).every((value) => value !== void 0);
|
|
2081
2162
|
useEffect2(() => {
|
|
2082
|
-
if (entityType && tagName &&
|
|
2163
|
+
if (entityType && tagName && paramsReady) {
|
|
2083
2164
|
listEntitiesByTag(entityType, tagName, opts);
|
|
2084
2165
|
}
|
|
2085
|
-
}, [entityType, opts, tagName,
|
|
2166
|
+
}, [entityType, opts, tagName, paramsReady, opts == null ? void 0 : opts.forceFetch]);
|
|
2086
2167
|
return {
|
|
2087
2168
|
entities,
|
|
2088
2169
|
entitiesMap: dataMap,
|
|
@@ -2289,6 +2370,11 @@ var initWebSocketActions = (monoriseStore, httpActions) => {
|
|
|
2289
2370
|
payload.entityId,
|
|
2290
2371
|
payload.data
|
|
2291
2372
|
);
|
|
2373
|
+
updateSearchResult(
|
|
2374
|
+
state,
|
|
2375
|
+
entityType,
|
|
2376
|
+
payload.data
|
|
2377
|
+
);
|
|
2292
2378
|
})
|
|
2293
2379
|
);
|
|
2294
2380
|
}
|
|
@@ -2300,6 +2386,7 @@ var initWebSocketActions = (monoriseStore, httpActions) => {
|
|
|
2300
2386
|
if ((_a = state.entity[key]) == null ? void 0 : _a.dataMap) {
|
|
2301
2387
|
state.entity[key].dataMap.delete(payload.entityId);
|
|
2302
2388
|
}
|
|
2389
|
+
removeFromSearchResults(state, entityType, payload.entityId);
|
|
2303
2390
|
})
|
|
2304
2391
|
);
|
|
2305
2392
|
}
|
|
@@ -2658,6 +2745,11 @@ var initWebSocketActions = (monoriseStore, httpActions) => {
|
|
|
2658
2745
|
state.entity[key] = { dataMap: /* @__PURE__ */ new Map(), isFirstFetched: false, lastKey: void 0 };
|
|
2659
2746
|
}
|
|
2660
2747
|
state.entity[key].dataMap.set(payload.entityId, payload.data);
|
|
2748
|
+
updateSearchResult(
|
|
2749
|
+
state,
|
|
2750
|
+
key,
|
|
2751
|
+
payload.data
|
|
2752
|
+
);
|
|
2661
2753
|
})
|
|
2662
2754
|
);
|
|
2663
2755
|
}
|
|
@@ -2667,6 +2759,11 @@ var initWebSocketActions = (monoriseStore, httpActions) => {
|
|
|
2667
2759
|
produce4((state) => {
|
|
2668
2760
|
var _a, _b;
|
|
2669
2761
|
(_b = (_a = state.entity[payload.entityType]) == null ? void 0 : _a.dataMap) == null ? void 0 : _b.delete(payload.entityId);
|
|
2762
|
+
removeFromSearchResults(
|
|
2763
|
+
state,
|
|
2764
|
+
payload.entityType,
|
|
2765
|
+
payload.entityId
|
|
2766
|
+
);
|
|
2670
2767
|
})
|
|
2671
2768
|
);
|
|
2672
2769
|
} else if (msg.type === "mutual.created" || msg.type === "mutual.updated") {
|
|
@@ -2900,7 +2997,11 @@ var initCoreService = (monoriseStore, axios2, opts) => {
|
|
|
2900
2997
|
return axios2.get(
|
|
2901
2998
|
opts2.customUrl || `${entityApiBaseUrl}/${entityType}`,
|
|
2902
2999
|
{
|
|
2903
|
-
|
|
3000
|
+
// Keyed by query, so a search sent while another is in flight isn't
|
|
3001
|
+
// handed the earlier query's request. The type's search key still
|
|
3002
|
+
// reports loading and errors.
|
|
3003
|
+
requestKey: `${getEntityRequestKey("search", entityType)}?query=${query}`,
|
|
3004
|
+
stateKeys: [getEntityRequestKey("search", entityType)],
|
|
2904
3005
|
params: { query },
|
|
2905
3006
|
isInterruptive: opts2.isInterruptive,
|
|
2906
3007
|
feedback: opts2.feedback
|