(state, query, expand, mutationKey)
| 32 | } |
| 33 | |
| 34 | function selectResult(state, query, expand, mutationKey) { |
| 35 | if (!query || !query.path) { |
| 36 | return { |
| 37 | ...loadState(), |
| 38 | results: [], |
| 39 | shouldLoad: false, |
| 40 | shouldLoadDeep: false, |
| 41 | isPending: true, |
| 42 | }; |
| 43 | } |
| 44 | const result = { |
| 45 | results: [], |
| 46 | ...selectObject(state, state.results, query.toKey(), mutationKey), |
| 47 | }; |
| 48 | if (expand) { |
| 49 | result.results = result.results |
| 50 | .map((id) => expand(state, id)) |
| 51 | .filter((r) => r.id !== undefined); |
| 52 | } |
| 53 | return result; |
| 54 | } |
| 55 | |
| 56 | export function selectLocale(state) { |
| 57 | // determine the active locale to be used by the user interface. this is |
no test coverage detected