mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
re-structure to monorepo.
This commit is contained in:
26
packages/webapp/src/store/receipts/receipts.selector.tsx
Normal file
26
packages/webapp/src/store/receipts/receipts.selector.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
// @ts-nocheck
|
||||
import { isEqual } from 'lodash';
|
||||
|
||||
import { paginationLocationQuery } from '@/store/selectors';
|
||||
import { createDeepEqualSelector } from '@/utils';
|
||||
import { defaultTableQuery } from './receipts.reducer';
|
||||
|
||||
const receiptTableStateSelector = (state) => state.salesReceipts.tableState;
|
||||
|
||||
// Retrieve receipts table query.
|
||||
export const getReceiptsTableStateFactory = () =>
|
||||
createDeepEqualSelector(
|
||||
paginationLocationQuery,
|
||||
receiptTableStateSelector,
|
||||
(locationQuery, tableState) => {
|
||||
return {
|
||||
...locationQuery,
|
||||
...tableState,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
export const receiptsTableStateChangedFactory = () =>
|
||||
createDeepEqualSelector(receiptTableStateSelector, (tableState) => {
|
||||
return !isEqual(tableState, defaultTableQuery);
|
||||
});
|
||||
Reference in New Issue
Block a user