Skip to content

Commit 701f807

Browse files
authored
change call API signature (#43)
1 parent 6efebcd commit 701f807

2 files changed

Lines changed: 6 additions & 10 deletions

File tree

lib/session.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,11 @@ export class Session {
207207

208208
async call(
209209
procedure: string,
210-
callOptions: {
211-
args?: any[] | null,
212-
kwargs?: { [key: string]: any } | null,
213-
options?: { [key: string]: any } | null
214-
} = {}
210+
args?: any[] | null,
211+
kwargs?: { [key: string]: any } | null,
212+
options?: { [key: string]: any } | null
215213
): Promise<Result> {
216-
const call = new Call(
217-
new CallFields(this._nextID, procedure, callOptions.args, callOptions.kwargs, callOptions.options)
218-
);
214+
const call = new Call(new CallFields(this._nextID, procedure, args, kwargs, options));
219215

220216
let promiseHandler: {
221217
resolve: (value: Result | PromiseLike<Result>) => void;

tests/interoptests/interop.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe("WAMP Tests", function () {
4646
const client = new Client({authenticator, serializer});
4747
const session = await client.connect(url, REALM);
4848

49-
const result = await session.call(PROCEDURE_ADD, {"args": [2, 2]});
49+
const result = await session.call(PROCEDURE_ADD, [2, 2]);
5050
expect(result.args[0]).toBe(4);
5151

5252
await session.close();
@@ -82,7 +82,7 @@ describe("WAMP Tests", function () {
8282
await callee.register("io.xconn.test", invHandler);
8383

8484
const caller = await client.connect(url, REALM);
85-
const result = await caller.call("io.xconn.test", {"args": args});
85+
const result = await caller.call("io.xconn.test", args);
8686
expect(result.args).toEqual(args);
8787

8888
await callee.close();

0 commit comments

Comments
 (0)