atlas-relax
Version:
A minimal, powerful declarative VDOM and reactive programming framework.
15 lines (14 loc) • 358 B
JavaScript
// Timer is used to record update times.
module.exports = class Timer {
constructor(events){
this.events = events;
this.start = Date.now()
}
log(type, f){
const e = {[type]: f.temp.data.id};
e.dt = Date.now() - this.start;
e.state = f.state && Object.assign({}, f.state);
this.events.push(e);
}
temp(f){this.log("wR", f)}
}