export function reducer()

in src/app/accounting/store/ledger/trial-balance.reducer.ts [35:62]


export function reducer(state = initialState, action: ledger.Actions): State {

  switch (action.type) {

    case ledger.LOAD_TRIAL_BALANCE: {
      const includeEmpty = action.payload;

      return Object.assign({}, state, {
        includeEmpty,
        loading: true
      });
    }

    case ledger.LOAD_TRIAL_BALANCE_COMPLETE: {
      const trialBalance = action.payload;

      return {
        trialBalance: trialBalance,
        loading: false,
        includeEmpty: state.includeEmpty
      };
    }

    default: {
      return state;
    }
  }
}