Skip to content

Commit

Permalink
Chain proxy creators to enable multiple calls in chains
Browse files Browse the repository at this point in the history
  • Loading branch information
amiika committed Aug 25, 2023
1 parent 58c0a2c commit 9220e8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/classes/RestEvent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export class RestEvent extends 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);
return new Proxy(instance, {
// @ts-ignore
Expand Down
4 changes: 2 additions & 2 deletions src/classes/SkipEvent.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
export class SkipEvent {

_fallbackMethod = (): SkipEvent => {
return this;
return SkipEvent.createSkipProxy();
}

public static createSkipProxy = () => {
public static createSkipProxy = (): SkipEvent => {
const instance = new SkipEvent();
return new Proxy(instance, {
// @ts-ignore
Expand Down

0 comments on commit 9220e8b

Please sign in to comment.