Skip to content

Commit 8e7c62e

Browse files
committed
refactor(core/bus): inline variable
1 parent 4d57694 commit 8e7c62e

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

src/core/bus/bus.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,21 @@ export interface ControlLines {
1313
HALT: Signal
1414
}
1515

16-
const initialControlLines: ControlLines = {
17-
RD: 0b0,
18-
WR: 0b0,
19-
MREQ: 0b0,
20-
IORQ: 0b0,
21-
CLK: 0b0,
22-
WAIT: 0b0,
23-
IRQ: 0b0,
24-
HALT: 0b0,
25-
}
26-
2716
export class Bus {
2817
// TODO: validate data and address
2918
readonly data$ = new BehaviorSubject(0x00)
3019
readonly address$ = new BehaviorSubject(0x00)
31-
readonly control$ = new BehaviorSubject(initialControlLines)
20+
21+
readonly control$ = new BehaviorSubject<ControlLines>({
22+
RD: 0b0,
23+
WR: 0b0,
24+
MREQ: 0b0,
25+
IORQ: 0b0,
26+
CLK: 0b0,
27+
WAIT: 0b0,
28+
IRQ: 0b0,
29+
HALT: 0b0,
30+
})
3231

3332
readonly clockRise$: Observable<ControlLines> = this.control$.pipe(
3433
filter((control, index) => (index && control.CLK)),

0 commit comments

Comments
 (0)