Removed package "autobind-decorator" and @boundMethod in favour of "auto-bind" util for constructors-only. (#5218)

This commit is contained in:
Roman authored and GitHub committed 2022-04-07 17:21:54 +03:00
1 parent 5f145e69e5
commit 06e7dfce5e
45 files changed
+150 -180

No files matched your search

+6 -8
View File
@@ -4,7 +4,7 @@
*/
import { action, computed, observable, makeObservable } from "mobx";
import { boundMethod } from "../utils";
import autoBind from "auto-bind";
export class SearchStore {
/**
@@ -15,6 +15,11 @@ export class SearchStore {
return value ? value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : "";
}
constructor() {
makeObservable(this);
autoBind(this);
}
/**
* Text in the search input
*
@@ -36,10 +41,6 @@ export class SearchStore {
*/
@observable activeOverlayIndex = -1;
constructor() {
makeObservable(this);
}
/**
* Sets default activeOverlayIndex
* @param text An array of any textual data (logs, for example)
@@ -109,12 +110,10 @@ export class SearchStore {
return prev;
}
@boundMethod
public setNextOverlayActive(): void {
this.activeOverlayIndex = this.getNextOverlay(true);
}
@boundMethod
public setPrevOverlayActive(): void {
this.activeOverlayIndex = this.getPrevOverlay(true);
}
@@ -140,7 +139,6 @@ export class SearchStore {
* @param line Index of the line where overlay is located
* @param occurrence Number of the overlay within one line
*/
@boundMethod
public isActiveOverlay(line: number, occurrence: number): boolean {
const firstLineIndex = this.occurrences.findIndex(item => item === line);