Skip to content

Commit

Permalink
feat: make constructor arguments as readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Jul 15, 2021
1 parent ecbb93a commit a4588ea
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions packages/common/src/services/grid.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export class GridService {
protected _rowSelectionPlugin?: SlickRowSelectionModel;

constructor(
protected gridStateService: GridStateService,
protected filterService: FilterService,
protected pubSubService: PubSubService,
protected paginationService: PaginationService,
protected sharedService: SharedService,
protected sortService: SortService,
protected treeDataService: TreeDataService,
protected readonly gridStateService: GridStateService,
protected readonly filterService: FilterService,
protected readonly pubSubService: PubSubService,
protected readonly paginationService: PaginationService,
protected readonly sharedService: SharedService,
protected readonly sortService: SortService,
protected readonly treeDataService: TreeDataService,
) { }

/** Getter of SlickGrid DataView object */
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/pagination.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class PaginationService {
grid!: SlickGrid;

/** Constructor */
constructor(protected pubSubService: PubSubService, protected sharedService: SharedService, protected backendUtilities?: BackendUtilityService, protected rxjs?: RxJsFacade) { }
constructor(protected readonly pubSubService: PubSubService, protected readonly sharedService: SharedService, protected readonly backendUtilities?: BackendUtilityService, protected rxjs?: RxJsFacade) { }

/** Getter of SlickGrid DataView object */
get dataView(): SlickDataView | undefined {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/resizer.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export class ResizerService {
return this.gridOptions?.resizeByContentOptions ?? {};
}

constructor(protected pubSubService: PubSubService) {
constructor(protected readonly pubSubService: PubSubService) {
this._eventHandler = new Slick.EventHandler();
}

Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/services/sort.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class SortService {
protected _isBackendGrid = false;
protected httpCancelRequests$?: Subject<void>; // this will be used to cancel any pending http request

constructor(protected sharedService: SharedService, protected pubSubService: PubSubService, protected backendUtilities?: BackendUtilityService, protected rxjs?: RxJsFacade) {
constructor(protected readonly sharedService: SharedService, protected readonly pubSubService: PubSubService, protected readonly backendUtilities?: BackendUtilityService, protected rxjs?: RxJsFacade) {
this._eventHandler = new Slick.EventHandler();
if (this.rxjs) {
this.httpCancelRequests$ = this.rxjs.createSubject<void>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class SlickFooterComponent {
this.renderRightFooterText(text);
}

constructor(protected grid: SlickGrid, protected customFooterOptions: CustomFooterOption, protected translaterService?: TranslaterService) {
constructor(protected readonly grid: SlickGrid, protected readonly customFooterOptions: CustomFooterOption, protected readonly translaterService?: TranslaterService) {
this._bindingHelper = new BindingHelper();
this._bindingHelper.querySelectorPrefix = `.${this.gridUid} `;
this._eventHandler = new Slick.EventHandler();
Expand Down

0 comments on commit a4588ea

Please sign in to comment.