Skip to content

Commit 4b3cb8d

Browse files
feat(core) add getContext to RpcArgumentsHost
1 parent ed7f652 commit 4b3cb8d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

packages/common/interfaces/features/arguments-host.interface.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export interface RpcArgumentsHost {
4343
* Returns the data object.
4444
*/
4545
getData<T = any>(): T;
46+
47+
/**
48+
* Returns the context object.
49+
*/
50+
getContext<T = any>(): T;
4651
}
4752

4853
/**

packages/core/helpers/execution-context-host.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export class ExecutionContextHost implements ExecutionContext {
4343
switchToRpc(): RpcArgumentsHost {
4444
return Object.assign(this, {
4545
getData: () => this.getArgByIndex(0),
46+
getContext: () => this.getArgByIndex(1),
4647
});
4748
}
4849

0 commit comments

Comments
 (0)