Skip to content

Commit ef93ff8

Browse files
hanslalexeagle
authored andcommitted
refactor(@angular-devkit/core): Type JobHandlerContext properly
The input field is not an unknown JsonValue, the type is part of the generic. It's validated by the scheduler.
1 parent ca31640 commit ef93ff8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/angular_devkit/core/src/experimental/jobs/create-job-handler.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export interface SimpleJobHandlerContext<
3939
> extends JobHandlerContext<A, I, O> {
4040
logger: LoggerApi;
4141
createChannel: (name: string) => Observer<JsonValue>;
42-
input: Observable<JsonValue>;
42+
input: Observable<I>;
4343
}
4444

4545

@@ -68,7 +68,7 @@ export function createJobHandler<A extends JsonValue, I extends JsonValue, O ext
6868
const handler = (argument: A, context: JobHandlerContext<A, I, O>) => {
6969
const description = context.description;
7070
const inboundBus = context.inboundBus;
71-
const inputChannel = new Subject<JsonValue>();
71+
const inputChannel = new Subject<I>();
7272
let subscription: Subscription;
7373

7474
return new Observable<JobOutboundMessage<O>>(subject => {
@@ -112,7 +112,7 @@ export function createJobHandler<A extends JsonValue, I extends JsonValue, O ext
112112

113113
const channels = new Map<string, Subject<JsonValue>>();
114114

115-
const newContext = {
115+
const newContext: SimpleJobHandlerContext<A, I, O> = {
116116
...context,
117117
input: inputChannel.asObservable(),
118118
logger,

0 commit comments

Comments
 (0)