Skip to content

Commit

Permalink
perf: changed reselect syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Laoujin committed Mar 9, 2024
1 parent 3fa89a1 commit b875bbb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@ const selectAllData = createSelector(

/** Calculates the totals needed for rendering the timesheet/inbound/outbound badges for one projectMonth */
export const createProjectMonthBadgesSelector = () => createSelector(
selectAllData,
(_, month: string) => month,
[
selectAllData,
(_, month: string) => month
],
({projectsMonth, projects, consultants, clients}, month) => {
const projectMonths = projectsMonth
.filter(x => x.month.isSame(month, 'month') && x.verified !== 'forced')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ const selectInvoices = (state: ConfacState) => state.invoices;


export const createFullProjectMonthsSelector = () => createSelector(
selectProjectMonths,
selectProjects,
selectConsultants,
selectClients,
selectInvoices,
(_, month: string) => month,
[
selectProjectMonths,
selectProjects,
selectConsultants,
selectClients,
selectInvoices,
(_, month: string) => month
],
(projectsMonth, projects, consultants, clients, invoices, month) => {
const context: ProjectMonthResolverState = {
projectsMonth, projects, consultants, clients, invoices
Expand Down

0 comments on commit b875bbb

Please sign in to comment.