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

Commit

Permalink
🐛 don't return anything if the query hasn't finished loading yet (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudWeyts committed Dec 2, 2019
1 parent 76641a0 commit b4b0d19
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit b4b0d19

Please sign in to comment.