Chain proxy creators to enable multiple calls in chains
This commit is contained in:
@ -8,10 +8,10 @@ export class RestEvent extends Event {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_fallbackMethod = (): Event => {
|
_fallbackMethod = (): Event => {
|
||||||
return this;
|
return RestEvent.createRestProxy(this.values["duration"], this.app);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static createRestProxy = (duration: number, app: Editor) => {
|
public static createRestProxy = (duration: number, app: Editor): RestEvent => {
|
||||||
const instance = new RestEvent(duration, app);
|
const instance = new RestEvent(duration, app);
|
||||||
return new Proxy(instance, {
|
return new Proxy(instance, {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
@ -1,10 +1,10 @@
|
|||||||
export class SkipEvent {
|
export class SkipEvent {
|
||||||
|
|
||||||
_fallbackMethod = (): SkipEvent => {
|
_fallbackMethod = (): SkipEvent => {
|
||||||
return this;
|
return SkipEvent.createSkipProxy();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static createSkipProxy = () => {
|
public static createSkipProxy = (): SkipEvent => {
|
||||||
const instance = new SkipEvent();
|
const instance = new SkipEvent();
|
||||||
return new Proxy(instance, {
|
return new Proxy(instance, {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
Reference in New Issue
Block a user