25 lines
339 B
TypeScript
25 lines
339 B
TypeScript
import { action } from "mobx";
|
|
import User from "./User";
|
|
import Model from "./base/Model";
|
|
|
|
class View extends Model {
|
|
id: string;
|
|
|
|
documentId: string;
|
|
|
|
firstViewedAt: string;
|
|
|
|
lastViewedAt: string;
|
|
|
|
count: number;
|
|
|
|
user: User;
|
|
|
|
@action
|
|
touch() {
|
|
this.lastViewedAt = new Date().toString();
|
|
}
|
|
}
|
|
|
|
export default View;
|