Skip to content
This repository has been archived by the owner on Apr 27, 2022. It is now read-only.

🐛Don't return anything if the query hasn't finished loading yet #153

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/store/entities/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ export const mergeEntitiesIntoPaths = (entities: EntitiesState, paths: string[],

export const selectMergedEntities = (state: State, { key }: { key: string }) => {
const { ids, data } = state.queries[key];

// Query hasn't finished loading yet
if (!ids && !data) {
return null;
}

const { domain, options } = decodeQueryCacheKey(key);

const include = options && options.include;
Expand Down