Skip to content

Commit

Permalink
feat: support multiple arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
sanchezcarlosjr committed Jul 16, 2023
1 parent e0dad91 commit 250fc19
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/app/notebook/shell/documentObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class DocumentObserver {
private tasks: Promise<any>[] = [];
public readonly rpc = new Proxy({}, {
get: (target, prop, receiver) =>
async (args: any) => this.call(prop.toString(), args)
async (...args: any) => this.call(prop as string, args)
});

constructor(
Expand Down Expand Up @@ -66,8 +66,8 @@ export class DocumentObserver {
}

async call(method:string, args?: any) {
if (args && 'toJs' in args && typeof args.toJs === 'function') {
args = args.toJs();
if (args && typeof args === 'object' && 'toJs' in args && typeof args.toJs === 'function') {
args = args?.toJs();
}
const document = DocumentObserver.setup(this.db, method, this.collection);
const id = randomCouchString(10);
Expand Down

0 comments on commit 250fc19

Please sign in to comment.