TxTask

  • is a simple class include three members 'method', 'status' and 'data'.

  • the task object is travel around all taksks / reply between components.

Example of using a TxTask with generic head:

type Head = {
  source: string;
  method: string;
  status: string;
}
 
type Data = { 
  data: string
}
 
let t = new TxTask<Head>({source: 'other', method: 'doit', status: 'ok'}, {data: 'this is again my data'});
 
let h: Head = t.head;
let d: Data = t.data;
 
assert.deepEqual({source: 'other', method: 'doit', status: 'ok'}, h);
assert.deepEqual({data: 'this is again my data'}, d);

Last updated