Skip to content

Commit 7d3274f

Browse files
committed
chore: remove unused client.send with callbacks (#450)
Fixes: #449
1 parent 4235b6c commit 7d3274f

File tree

2 files changed

+2
-56
lines changed

2 files changed

+2
-56
lines changed

Diff for: packages/smithy-client/src/client.ts

+2-34
Original file line numberDiff line numberDiff line change
@@ -36,44 +36,12 @@ export class Client<
3636
SmithyResolvedConfiguration<HandlerOptions>
3737
>,
3838
options?: HandlerOptions
39-
): Promise<OutputType>;
40-
send<InputType extends ClientInput, OutputType extends ClientOutput>(
41-
command: Command<
42-
ClientInput,
43-
InputType,
44-
ClientOutput,
45-
OutputType,
46-
SmithyResolvedConfiguration<HandlerOptions>
47-
>,
48-
options: HandlerOptions,
49-
cb: (err: any, data?: OutputType) => void
50-
): void;
51-
send<InputType extends ClientInput, OutputType extends ClientOutput>(
52-
command: Command<
53-
ClientInput,
54-
InputType,
55-
ClientOutput,
56-
OutputType,
57-
SmithyResolvedConfiguration<HandlerOptions>
58-
>,
59-
options?: HandlerOptions,
60-
cb?: (err: any, data?: OutputType) => void
61-
): Promise<OutputType> | void {
39+
): Promise<OutputType> {
6240
const handler = command.resolveMiddleware(
6341
this.middlewareStack as any,
6442
this.config,
6543
options
6644
);
67-
if (cb) {
68-
handler(command)
69-
.then(result => cb(null, result.output), (err: any) => cb(err))
70-
.catch(
71-
// prevent any errors thrown in the callback from triggering an
72-
// unhandled promise rejection
73-
() => {}
74-
);
75-
} else {
76-
return handler(command).then(result => result.output);
77-
}
45+
return handler(command).then(result => result.output);
7846
}
7947
}

Diff for: packages/types/src/client.ts

-22
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,6 @@ interface InvokeFunction<
2020
>,
2121
options?: any
2222
): Promise<OutputType>;
23-
<InputType extends InputTypes, OutputType extends OutputTypes>(
24-
command: Command<
25-
InputTypes,
26-
InputType,
27-
OutputTypes,
28-
OutputType,
29-
ResolvedClientConfiguration
30-
>,
31-
options: any,
32-
cb: (err: any, data?: OutputType) => void
33-
): void;
34-
<InputType extends InputTypes, OutputType extends OutputTypes>(
35-
command: Command<
36-
InputTypes,
37-
InputType,
38-
OutputTypes,
39-
OutputType,
40-
ResolvedClientConfiguration
41-
>,
42-
options?: any,
43-
cb?: (err: any, data?: OutputType) => void
44-
): Promise<OutputType> | void;
4523
}
4624

4725
/**

0 commit comments

Comments
 (0)