重构tracer设计
This commit is contained in:
@@ -1,10 +1,20 @@
|
||||
import { Commander } from './commander';
|
||||
import { ArrayTracer } from './tracer';
|
||||
import { getTracerContext } from './context';
|
||||
import {
|
||||
createArrayTracer,
|
||||
createControlTracer,
|
||||
createLogTracer,
|
||||
} from './tracers';
|
||||
|
||||
const arrayTracer = ArrayTracer.define<number>({ description: 'Array Tracer' });
|
||||
const logTracer = createLogTracer({ description: 'LogTracer' });
|
||||
const controlTracer = createControlTracer({ description: 'ControlTracer' });
|
||||
|
||||
arrayTracer.preset([1, 2, 3]);
|
||||
const arrayTracer = createArrayTracer<number>({
|
||||
description: 'ArrayTracer',
|
||||
array: [1, 2, 3],
|
||||
});
|
||||
|
||||
const commander = Commander.getInstance();
|
||||
const commands = commander.output();
|
||||
console.log(commands);
|
||||
arrayTracer.patch(0, 100);
|
||||
|
||||
controlTracer.step();
|
||||
|
||||
console.log(getTracerContext().commands);
|
||||
|
||||
Reference in New Issue
Block a user