react-native-xenon
Version:
A powerful in-app debugging tool for React Native.
25 lines (18 loc) • 546 B
text/typescript
import { frozen } from '../core/utils';
export default abstract class Interceptor<T extends Object> {
get isInterceptorEnabled() {
return this.
}
protected set isInterceptorEnabled(value: boolean) {
this.
}
protected abstract handlers: T;
@frozen
set<K extends keyof T>(key: K, handler: T[K]) {
this.handlers[key] ??= handler;
return this;
}
abstract enableInterception(): void;
abstract disableInterception(): void;
}