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:
33
packages/webapp/src/store/Invoice/invoices.selector.tsx
Normal file
33
packages/webapp/src/store/Invoice/invoices.selector.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
// @ts-nocheck
|
||||
import { isEqual } from 'lodash';
|
||||
import { paginationLocationQuery } from '@/store/selectors';
|
||||
import { createDeepEqualSelector } from '@/utils';
|
||||
import { defaultTableQuery } from './invoices.reducer';
|
||||
|
||||
const invoicesTableStateSelector = (state) => state.salesInvoices.tableState;
|
||||
|
||||
/**
|
||||
* Retrieve invoices table state.
|
||||
*/
|
||||
export const getInvoicesTableStateFactory = () =>
|
||||
createDeepEqualSelector(
|
||||
paginationLocationQuery,
|
||||
invoicesTableStateSelector,
|
||||
(locationQuery, tableState) => {
|
||||
return {
|
||||
...locationQuery,
|
||||
...tableState,
|
||||
};
|
||||
},
|
||||
);
|
||||
|
||||
/**
|
||||
* Retrieve invoices table state.
|
||||
*/
|
||||
export const isInvoicesTableStateChangedFactory = () =>
|
||||
createDeepEqualSelector(
|
||||
invoicesTableStateSelector,
|
||||
(tableState) => {
|
||||
return !isEqual(tableState, defaultTableQuery);
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user