* Fix action creator unnecessary render issue - Optimize the selectors and hooks to return new values only when something has changed. * Fix ActionEntityContextMenu re-renders issue * Prevent rerenders of EntityName component * Fix CodeEditor re-renders * Use createSelector instead of memoization. * Cleanup * - Remove whyDidYouRender Co-authored-by: Satish Gandham <satish@appsmith.com>
15 lines
407 B
TypeScript
15 lines
407 B
TypeScript
import { createSelector } from "reselect";
|
|
|
|
import { AppState } from "reducers";
|
|
import { RecentEntity } from "components/editorComponents/GlobalSearch/utils";
|
|
|
|
export const getRecentEntities = (state: AppState) =>
|
|
state.ui.globalSearch.recentEntities;
|
|
|
|
export const getRecentEntityIds = createSelector(
|
|
getRecentEntities,
|
|
(entities: RecentEntity[]) => {
|
|
return entities.map((r) => r.id);
|
|
},
|
|
);
|