Skip to content
Snippets Groups Projects
action.ts 294 B
Newer Older
export class Action {
  type: string;
  timestamp: Date;
  id: string | number;

  constructor(type: string, id: string | number) {
    this.type = type;
    this.id = id;
    this.timestamp = new Date();
  }

  get timeSince(): number {
    return Date.now() - this.timestamp.getTime();
  }
}