2022-01-20 02:46:01 +01:00
|
|
|
// @flow
|
|
|
|
type State = { costInfo: any };
|
2021-10-08 05:47:39 +02:00
|
|
|
|
2022-01-20 02:46:01 +01:00
|
|
|
export const selectState = (state: State) => state.costInfo || {};
|
|
|
|
export const selectAllCostInfoByUri = (state: State) => selectState(state).byUri;
|
|
|
|
export const selectFetchingCostInfo = (state: State) => selectState(state).fetching;
|
2021-10-08 05:47:39 +02:00
|
|
|
|
2022-01-20 02:46:01 +01:00
|
|
|
export const selectCostInfoForUri = (state: State, uri: string) => {
|
|
|
|
const costInfos = selectAllCostInfoByUri(state);
|
|
|
|
return costInfos && costInfos[uri];
|
|
|
|
};
|
2021-10-08 05:47:39 +02:00
|
|
|
|
2022-01-20 02:46:01 +01:00
|
|
|
export const selectFetchingCostInfoForUri = (state: State, uri: string) => {
|
|
|
|
const fetchingByUri = selectFetchingCostInfo(state);
|
|
|
|
return fetchingByUri && fetchingByUri[uri];
|
|
|
|
};
|